From 8d30ccafc17b8255a31cbe573338d49e7991da65 Mon Sep 17 00:00:00 2001 From: John <3859906+saltchicken@users.noreply.github.com> Date: Sun, 15 Mar 2020 10:41:52 -0700 Subject: [PATCH 1/2] Update quickstart example in README.md Fixed import and function call. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb36bb7..e3afc12 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,10 @@ Hue_plus can easily be integrated into existing software. The entire codebase is ``` import serial -import hue_plus +from hue_plus import hue ser = serial.Serial(args.port, 256000) -hue_plus.fixed(ser, 0, 0, 'FF0000') # First argument is ser, second is whether to bring up GUI (0=no), third is channel (0=both) and last is the color +hue.fixed(ser, 0, 0, 'FF0000') # First argument is ser, second is whether to bring up GUI (0=no), third is channel (0=both) and last is the color ``` ### Common args From b4d4e5633c89b7c39b31db57be7fe7b508ef7c36 Mon Sep 17 00:00:00 2001 From: John <3859906+saltchicken@users.noreply.github.com> Date: Sun, 15 Mar 2020 11:20:20 -0700 Subject: [PATCH 2/2] Update hue.py Changed variable 'color' to tuple in 'create_command' function call. Fixed ValueError: invalid literal for int() with base 16: ''. --- hue_plus/hue.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hue_plus/hue.py b/hue_plus/hue.py index ffd156c..3b28d0f 100755 --- a/hue_plus/hue.py +++ b/hue_plus/hue.py @@ -434,7 +434,7 @@ def breathing(ser, gui, channel, color, speed): for i in range(gui): color.append(picker.pick("Color "+str(i+1) + " of "+str(gui))) - command = create_command(ser, channel, color, "breathing", 0, 0, 0, speed) + command = create_command(ser, channel, [color], "breathing", 0, 0, 0, speed) outputs = previous.get_colors(channel, command) write(ser, outputs) @@ -447,7 +447,7 @@ def fading(ser, gui, channel, color, speed): for i in range(gui): color.append(picker.pick("Color "+str(i+1) + " of "+str(gui))) - command = create_command(ser, channel, color, "fading", 0, 0, 0, speed) + command = create_command(ser, channel, [color], "fading", 0, 0, 0, speed) outputs = previous.get_colors(channel, command) write(ser, outputs) @@ -472,7 +472,7 @@ def cover_marquee(ser, gui, channel, color, speed, direction): for i in range(gui): color.append(picker.pick("Color "+str(i+1) + " of "+str(gui))) - command = create_command(ser, channel, color, "cover_marquee", direction, 0, 0, speed) + command = create_command(ser, channel, [color], "cover_marquee", direction, 0, 0, speed) outputs = previous.get_colors(channel, command) write(ser, outputs) @@ -484,7 +484,7 @@ def pulse(ser, gui, channel, color, speed): for i in range(gui): color.append(picker.pick("Color "+str(i+1) + " of "+str(gui))) - command = create_command(ser, channel, color, "pulse", 0, 0, 0, speed) + command = create_command(ser, channel, [color], "pulse", 0, 0, 0, speed) outputs = previous.get_colors(channel, command) write(ser, outputs) @@ -510,7 +510,7 @@ def alternating(ser, gui, channel, color, speed, size, moving, direction): else: option = 0 - command = create_command(ser, channel, color, "alternating", direction, option, size, speed) + command = create_command(ser, channel, [color], "alternating", direction, option, size, speed) outputs = previous.get_colors(channel, command) write(ser, outputs)