Skip to content

Commit

Permalink
Fix previous write
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustav Hansen committed Apr 15, 2017
1 parent edb3bed commit a7e5123
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions hue_plus/hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,5 +510,8 @@ def profile_apply(ser, name):
init(ser)
write(ser, commands)

def write_previous(ser):
write(ser, previous.get_previous())

if __name__ == '__main__':
main()
6 changes: 5 additions & 1 deletion hue_plus/hue_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ def __init__(self):
self.error("No Hue+ found.")

self.profileListFunc()
hue.write(ser, previous.get_previous()) # Set the previous colors
try:
with serial.Serial(self.portTxt.text(), 256000) as ser:
hue.write_previous(ser)
except serial.serialutil.SerialException:
self.error("Serial port is invalid. Try /dev/ttyACM0 for Linux or COM3 or COM4 for Windows")

def error(self, message):
msg = QMessageBox()
Expand Down

0 comments on commit a7e5123

Please sign in to comment.