Pebble.Health

Access Pebble Health data such as step count, active time, distance, sleep, calories, and heart rate.

Native Pebble C API

Types

Metric

type Metric
    = StepCount
    | ActiveSeconds
    | WalkedDistanceMeters
    | SleepSeconds
    | RestfulSleepSeconds
    | RestingKCalories
    | ActiveKCalories
    | HeartRateBPM

A Pebble health metric.

Event

type Event
    = SignificantUpdate
    | MovementUpdate
    | SleepUpdate

A Pebble health service event.

Commands

supported

supported : (Bool -> msg) -> Cmd msg

Request whether the Health API is available on this watch.

value

value : Metric -> (Int -> msg) -> Cmd msg

Request the current value for a metric.

For example, value StepCount GotSteps requests the current step count.

sumToday

sumToday : Metric -> (Int -> msg) -> Cmd msg

Request today's total for a metric.

sum

sum : Metric -> Int -> Int -> (Int -> msg) -> Cmd msg

Request the total for a metric between two Unix timestamps in seconds.

accessible

accessible : Metric -> Int -> Int -> (Bool -> msg) -> Cmd msg

Request whether a metric is available between two Unix timestamps in seconds.

Subscriptions

onEvent

onEvent : (Event -> msg) -> Sub msg

Receive health service events.