Skip to content

Commit

Permalink
fix chase when the number of colors in the colors list is not exactly…
Browse files Browse the repository at this point in the history
… six
  • Loading branch information
bikerglen committed Jan 17, 2024
1 parent c90f1bd commit c8041ac
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 c8041ac

Please sign in to comment.