Skip to content

Instantly share code, notes, and snippets.

@towynlin
Created July 5, 2019 07:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save towynlin/a14a049f7ab38ebc94d62ff9a4c2eef5 to your computer and use it in GitHub Desktop.
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...
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