This commit is contained in:
fuenmao
2026-11-13 14:03:25 +08:00
parent 718b138033
commit 9cfd9e24d7
6 changed files with 105 additions and 9 deletions
@@ -25,8 +25,17 @@ public sealed class ConfiguredSleepLightModule : HealthDeviceModule
}
public override async Task SetPowerAsync(bool turnOn, CancellationToken token)
{
if (turnOn) { await _transition.StartSleepAsync(2700, token); return; }
if (turnOn && _light.StartSleepOnManualPowerOn)
{
await _transition.StartSleepAsync(2700, token);
return;
}
await _transition.CancelAsync(token);
if (turnOn)
{
await base.SetPowerAsync(true, token);
return;
}
var command = GetShutdownCommands().Single();
await Runner.SendAsync(command, token);
await Runner.VerifyParameterAsync(command, token);