Elm Pebble

Pebble.Companion.Command

Build command envelopes for the JavaScript companion bridge.

Most higher-level companion modules use this module internally, but it is handy when you need to talk to a custom bridge API.

import Json.Encode as Encode
import Pebble.Companion.Command as Command

vibrateCommand =
    Command.command "cmd-1" "watch" "vibrate"
        |> Command.withPayload (Encode.object [])

Command envelopes

Values

command

command : String -> String -> String -> CommandEnvelope

Build a command envelope with an empty payload.

withPayload

withPayload : Encode.Value -> CommandEnvelope -> CommandEnvelope

Replace payload on an existing command envelope.