diff options
-rw-r--r-- | ParrotZik.py | 9 | ||||
-rw-r--r-- | icons/Headphone.ico | bin | 0 -> 112262 bytes | |||
-rw-r--r-- | icons/audio-headset.png | bin | 0 -> 2885 bytes | |||
-rw-r--r-- | icons/battery-040.png | bin | 0 -> 2424 bytes | |||
-rw-r--r-- | icons/battery-060.png | bin | 0 -> 2537 bytes | |||
-rw-r--r-- | icons/battery-080.png | bin | 0 -> 2617 bytes | |||
-rw-r--r-- | icons/battery-100.png | bin | 0 -> 2603 bytes | |||
-rw-r--r-- | icons/battery-caution-3.png | bin | 0 -> 1587 bytes | |||
-rw-r--r-- | icons/battery-low.png | bin | 0 -> 2334 bytes |
9 files changed, 7 insertions, 2 deletions
diff --git a/ParrotZik.py b/ParrotZik.py index b7f5dd7..08b7f30 100644 --- a/ParrotZik.py +++ b/ParrotZik.py @@ -13,7 +13,8 @@ class ParrotZik(object): if len(service_matches) == 0: print "Couldn't find Parrot Zik" - return False + self.sock = '' + return first_match = service_matches[0] port = first_match["port"] @@ -87,7 +88,11 @@ class ParrotZik(object): return self.sendMessage(message) def sendMessage(self,message): - self.sock.send(str(message)) + try: + self.sock.send(str(message)) + except: + self.sock = '' + return data = self.sock.recv(7) len = struct.unpack('B', data[1])[0] data = self.sock.recv(1024) diff --git a/icons/Headphone.ico b/icons/Headphone.ico Binary files differnew file mode 100644 index 0000000..0bddf34 --- /dev/null +++ b/icons/Headphone.ico diff --git a/icons/audio-headset.png b/icons/audio-headset.png Binary files differnew file mode 100644 index 0000000..42164bb --- /dev/null +++ b/icons/audio-headset.png diff --git a/icons/battery-040.png b/icons/battery-040.png Binary files differnew file mode 100644 index 0000000..333e699 --- /dev/null +++ b/icons/battery-040.png diff --git a/icons/battery-060.png b/icons/battery-060.png Binary files differnew file mode 100644 index 0000000..5d21461 --- /dev/null +++ b/icons/battery-060.png diff --git a/icons/battery-080.png b/icons/battery-080.png Binary files differnew file mode 100644 index 0000000..83fa2fa --- /dev/null +++ b/icons/battery-080.png diff --git a/icons/battery-100.png b/icons/battery-100.png Binary files differnew file mode 100644 index 0000000..0e818c3 --- /dev/null +++ b/icons/battery-100.png diff --git a/icons/battery-caution-3.png b/icons/battery-caution-3.png Binary files differnew file mode 100644 index 0000000..f97b54c --- /dev/null +++ b/icons/battery-caution-3.png diff --git a/icons/battery-low.png b/icons/battery-low.png Binary files differnew file mode 100644 index 0000000..86546be --- /dev/null +++ b/icons/battery-low.png |