Created
July 5, 2019 07:29
-
-
Save towynlin/a14a049f7ab38ebc94d62ff9a4c2eef5 to your computer and use it in GitHub Desktop.
I just wanted to set the time on my pebble, but there's no more app on the play store. So, after some fun searching, reading, learning, trial, and error...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
from libpebble2.communication import PebbleConnection | |
from libpebble2.communication.transports.serial import SerialTransport | |
from libpebble2.protocol.base import PebblePacket | |
from libpebble2.protocol.base.types import * | |
from libpebble2.protocol.system import * | |
pebble = PebbleConnection(SerialTransport(sys.argv[1])) # argument like /dev/cu.Pebble... | |
pebble.connect() | |
pebble.send_packet(TimeMessage(message=SetUTC(utc_offset=-420, tz_name=u"America/Los_Angeles", unix_time=round(time.time())))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment