Skip to content

Commit b288d97

Browse files
committed
improve yeelight further
1 parent 39acf99 commit b288d97

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Project-Aurora/Project-Aurora/Devices/YeeLight/YeeLightState.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ protected static Task<bool> StateTask
1717
_stateTask.Wait();
1818
_stateTask = value;
1919
}
20+
get => _stateTask;
2021
}
2122

2223
void InitState();
@@ -71,13 +72,15 @@ public IYeeLightState Update(Color color)
7172
return newState;
7273
}
7374

74-
private void TurnOff()
75+
private async void TurnOff()
7576
{
77+
await IYeeLightState.StateTask;
7678
_lights.ForEach(device => device.SetPower(Constants.PowerStateParamValues.OFF));
7779
}
7880

79-
private void TurnOn()
81+
private async void TurnOn()
8082
{
83+
await IYeeLightState.StateTask;
8184
_lights.ForEach(device => device.SetPower(Constants.PowerStateParamValues.ON));
8285
}
8386
}
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)