Catch the ValueError if the bulb was in the wrong mode ()

This commit is contained in:
Fabian Affolter 2018-07-13 20:01:57 +02:00 committed by GitHub
parent e60f9ca392
commit 79955a5785
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,7 +155,11 @@ class MyStromLight(Light):
self._state = self._bulb.get_status()
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_s = int(color_s)