Pebble.Hardware
Enhanced hardware access for Pebble watch devices.
Types
Vibration
Backlight
System Status
Audio (if supported)
Union Types
VibrationType
type VibrationTypetype VibrationType
= Short
| Long
| Double
| NudgeTypes of vibration available.
BacklightLevel
type BacklightLeveltype BacklightLevel
= Off
| Low
| Medium
| High
| MaxBacklight intensity levels.
HardwareCmd
type HardwareCmd msgtype HardwareCmd
= Vibrate VibrationType
| VibratePattern VibrationPattern
| SetBacklight BacklightLevel Int
| GetBatteryLevel (Int -> msg)
| GetConnectionStatus (Bool -> msg)
| PlayTone Int Int
| StopToneCommands for watch hardware operations.
Type Aliases
VibrationPattern
type alias VibrationPattern = List ( Int, Int )Custom vibration patterns as a list of (duration_ms, pause_ms) pairs.
Values
vibrate
vibrate : VibrationType -> HardwareCmd msgTrigger a simple vibration.
vibratePattern
vibratePattern : VibrationPattern -> HardwareCmd msgCreate a custom vibration pattern.
setBacklight
setBacklight : BacklightLevel -> Int -> HardwareCmd msgSet backlight level for a specific duration.
enableBacklight
enableBacklight : HardwareCmd msgEnable backlight at medium level for 3 seconds.
disableBacklight
disableBacklight : HardwareCmd msgTurn off backlight immediately.
flashBacklight
flashBacklight : HardwareCmd msgFlash backlight for attention.
getBatteryLevel
getBatteryLevel : (Int -> msg) -> HardwareCmd msgGet current battery level (0-100).
getConnectionStatus
getConnectionStatus : (Bool -> msg) -> HardwareCmd msgCheck if connected to phone via Bluetooth.
playTone
playTone : Int -> Int -> HardwareCmd msgPlay a tone at specific frequency and duration.
stopTone
stopTone : HardwareCmd msgStop any currently playing tone.