11
This commit is contained in:
@@ -38,9 +38,13 @@ public sealed class LightingModule : HealthDeviceModule
|
||||
|
||||
public override async Task ExecuteParameterAsync(DeviceCommand command, CancellationToken cancellationToken)
|
||||
{
|
||||
// 标准手动面板复用本灯的专属安全钩子;其他灯不会触发助眠灯/床垫联动。
|
||||
command = command with { Intent = command.Service == "turn_off"
|
||||
? DeviceCommandIntent.TurnRelaxationLightOff : DeviceCommandIntent.TurnRelaxationLightOn };
|
||||
await _transition.CancelAsync(cancellationToken);
|
||||
await base.ExecuteParameterAsync(command, cancellationToken);
|
||||
await Runner.SendAsync(command, cancellationToken);
|
||||
if (command.Service == "turn_off") await _lightOff.NotifyAsync(cancellationToken);
|
||||
if (command.ExpectedState is not null) await Runner.VerifyParameterAsync(command, cancellationToken);
|
||||
}
|
||||
|
||||
public override async Task SetPowerAsync(bool turnOn, CancellationToken cancellationToken)
|
||||
|
||||
Reference in New Issue
Block a user