This commit is contained in:
fuenmao
2026-10-09 18:06:11 +08:00
parent e6b90a06ab
commit 2d44cc3966
17 changed files with 1161 additions and 264 deletions
@@ -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)