mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Catch the ValueError if the bulb was in the wrong mode (#15434)
This commit is contained in:
parent
e60f9ca392
commit
79955a5785
@ -155,7 +155,11 @@ class MyStromLight(Light):
|
|||||||
self._state = self._bulb.get_status()
|
self._state = self._bulb.get_status()
|
||||||
|
|
||||||
colors = self._bulb.get_color()['color']
|
colors = self._bulb.get_color()['color']
|
||||||
color_h, color_s, color_v = colors.split(';')
|
try:
|
||||||
|
color_h, color_s, color_v = colors.split(';')
|
||||||
|
except ValueError:
|
||||||
|
color_s, color_v = colors.split(';')
|
||||||
|
color_h = 0
|
||||||
|
|
||||||
self._color_h = int(color_h)
|
self._color_h = int(color_h)
|
||||||
self._color_s = int(color_s)
|
self._color_s = int(color_s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user