Pebble.Cmd
Core watch commands.
Use this module for generic scheduling. Hardware controls live in Pebble.Vibes and Pebble.Light, watch metadata requests live in Pebble.WatchInfo, and key-value persistence helpers live in Pebble.Storage.
type Msg
= WakeUp
| Tick
init _ =
( model, Cmd.timerAfter 1000 Tick )
update msg model =
case msg of
Tick ->
( model, Cmd.timerAfter 1000 Tick )
WakeUp ->
( model, Cmd.none )Native Pebble C API
- Timer on developer.repebble.com
Scheduling
none
none : Cmd msgA command that does nothing.
timerAfter
timerAfter : Int -> Cmd msgRun a command after ms milliseconds.
Time
CurrentDateTime
type alias CurrentDateTime =
{ year : Int
, month : Int
, day : Int
, dayOfWeek : Weekday
, hour : Int
, minute : Int
, second : Int
, utcOffsetMinutes : Int
}Structured local time/date information from the watch runtime.
getCurrentDateTime
getCurrentDateTime : (CurrentDateTime -> msg) -> Cmd msgRequest the current local date/time with UTC offset in minutes.