Skip to content

Commit 9935b5c

Browse files
authored
Merge pull request #615 from Ircama/ircama-python2
Fix initialization bug with python2 (embedded devices)
2 parents 49cd721 + 7075b18 commit 9935b5c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tinytuya/BulbDevice.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ def _hexvalue_to_rgb(hexvalue, bulb="A"):
193193
b = int(rgb[2] * 255)
194194
else:
195195
# Unsupported bulb type
196-
raise ValueError(f"Unsupported bulb type {bulb} - unable to determine RGB values.")
196+
raise ValueError(
197+
"Unsupported bulb type {} - unable to determine RGB values.".format(bulb)
198+
)
197199

198200
return (r, g, b)
199201

@@ -217,7 +219,9 @@ def _hexvalue_to_hsv(hexvalue, bulb="A"):
217219
v = int(hexvalue[8:12], 16) / 1000.0
218220
else:
219221
# Unsupported bulb type
220-
raise ValueError(f"Unsupported bulb type {bulb} - unable to determine HSV values.")
222+
raise ValueError(
223+
"Unsupported bulb type {} - unable to determine HSV values.".format(bulb)
224+
)
221225

222226
return (h, s, v)
223227

0 commit comments

Comments
 (0)