Skip to content

Commit

Permalink
Merge pull request #446 from bikerglen/fix-xmc-string-example
Browse files Browse the repository at this point in the history
fix chase when the number of colors in the colors list is not exactly six
  • Loading branch information
jasonacox committed Jan 18, 2024
2 parents c90f1bd + c8041ac commit 9036e93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/Contrib/XmCosyStringLight-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def xmcosy_string_lights_encode_colors (lights, colors, offset):
# make the colors chase down the string
d = tinytuya.BulbDevice(DEVICE_ID, DEVICE_IP, DEVICE_KEY, version=DEVICE_VER, persist=False)
while True:
for i in range (6):
d102 = xmcosy_string_lights_encode_colors (lights, colors, 5-i)
for i in range (len(colors)):
d102 = xmcosy_string_lights_encode_colors (lights, colors, len(colors)-1-i)
d.set_value (102, d102)
time.sleep(1)

0 comments on commit 9036e93

Please sign in to comment.