You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to send a notification (via WebSocketTransport), a problem occured.
When the notification is built, it creates some TimelineItem objects and one of them has a float value. So when it is serialised by PebblePacket.serialize(), Field.value_to_byte() is called and this line breaks :
return struct.pack(str(self.endianness or default_endianness) + self.struct_format, value)
In deed, since the endianness is a little indian < (for this case), it can convert only python int value.
Rigth now I just cast the value into an int and it works perfectly but I don't know if the fact that this float is given is actually a lib problem.
Thanks for your help !
PS : If it can help, here is my code
from libpebble2.communication import PebbleConnection
from libpebble2.communication.transports.websocket import WebsocketTransport
from libpebble2.services.notifications import Notifications
pebble = PebbleConnection(WebsocketTransport("ws://192.168.0.13:9000/"))
pebble.connect()
pebble.run_async()
print(pebble.watch_info.serial)
notif = Notifications(pebble)
notif.send_notification(u'Star Wars', u'Luke, I am your father', u'Dark vador')
The text was updated successfully, but these errors were encountered:
Hi pebblers !
While trying to send a notification (via
WebSocketTransport
), a problem occured.When the notification is built, it creates some
TimelineItem
objects and one of them has a float value. So when it is serialised byPebblePacket.serialize()
,Field.value_to_byte()
is called and this line breaks :return struct.pack(str(self.endianness or default_endianness) + self.struct_format, value)
In deed, since the endianness is a little indian
<
(for this case), it can convert only python int value.Rigth now I just cast the value into an int and it works perfectly but I don't know if the fact that this float is given is actually a lib problem.
Thanks for your help !
PS : If it can help, here is my code
The text was updated successfully, but these errors were encountered: