Skip to content
Snippets Groups Projects
Commit 585e9da4 authored by jkerdreu's avatar jkerdreu
Browse files

Fix set_hsv whe, light is off



git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2940 b32b6428-25c9-4566-ad07-03861ab6144f
parent af254efe
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,11 @@ class RGBLamp(MerossDev):
hsv = _hsv
h,s,v = hsv
rgb=tuple(round(i * 255) for i in colorsys.hsv_to_rgb(h/360.0,s,v))
# meross API fail to detect when light is off and set_light_color() is called
# set_light_color() will turn light on but the API think it is still off
# so turn it on first
if self.embs[0].attributes['light'] == False:
await self.meross.async_turn_on()
await self.meross.async_set_light_color(rgb=rgb)
await self.update()
self.embs[0].attributes['mode'] = 'color'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment