SDK 的 Bug 修复
This commit is contained in:
@@ -127,16 +127,20 @@ public class DeviceConfigHandler : ICommandHandler
|
||||
if (dto.ImmediateExecution)
|
||||
{
|
||||
// 情况 1: 收到“启动”指令
|
||||
if (!device.IsOnline) // 只有没在线时才点火
|
||||
if (!device.IsActived) // 只有没在线时才点火
|
||||
{
|
||||
_sysLog.Warning($"[Sync] 设备立即启动 => ID:{dto.Id} Name:{dto.Name} IP:{dto.IpAddress} Port:{dto.Port} Brand:{(DeviceBrand)dto.Brand} Rtsp:{dto.RtspPath}");
|
||||
_ = device.StartAsync();
|
||||
// 必须在线再执行
|
||||
if (device.IsPhysicalOnline)
|
||||
{
|
||||
_sysLog.Warning($"[Sync] 设备立即启动 => ID:{dto.Id} Name:{dto.Name} IP:{dto.IpAddress} Port:{dto.Port} Brand:{(DeviceBrand)dto.Brand} Rtsp:{dto.RtspPath}");
|
||||
_ = device.StartAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 情况 2: 收到“停止”指令 (即 ImmediateExecution = false)
|
||||
if (device.IsOnline) // 只有在线时才熄火
|
||||
if (device.IsActived) // 只有在线时才熄火
|
||||
{
|
||||
_sysLog.Warning($"[Sync] 设备立即停止 {dto.Id}");
|
||||
_ = device.StopAsync();
|
||||
|
||||
Reference in New Issue
Block a user