aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xclient/ur_fuzzy_alarm_clock.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/client/ur_fuzzy_alarm_clock.py b/client/ur_fuzzy_alarm_clock.py
index d6e5a1b..cb4e509 100755
--- a/client/ur_fuzzy_alarm_clock.py
+++ b/client/ur_fuzzy_alarm_clock.py
@@ -33,15 +33,15 @@ class FuzzyAlarmClock:
self.mock = False
def set_time_to_now(self):
- now = 's'+datetime.datetime.now().strftime("%y%m%d%u%H%M%S")
+ now = b's'+datetime.datetime.now().strftime("%y%m%d%u%H%M%S").encode('ascii')
self.serial.write(now)
def read_alarms(self, n):
data = []
self.serial.flushInput()
- self.serial.write('p')
+ self.serial.write(b'p')
for i in range(n):
- data.append(self.serial.readline())
+ data.append(self.serial.readline().decode('ascii'))
for i in range(n):
data[i] = data[i].split(' ')[2:-1]
days = []
@@ -59,7 +59,7 @@ class FuzzyAlarmClock:
s += "%02x" % (b0)
for val in values[8:]:
s += "%02x" % (val)
- self.serial.write(s)
+ self.serial.write(s.encode('ascii'))
class ModEdit(urwid.IntEdit):