Update and format config example
Also add dhall-json for testing json/yaml conversion
This commit is contained in:
parent
7b2a92012b
commit
3065040189
|
@ -1,16 +1,26 @@
|
|||
{ mqtt_servers.default = { host = "1.2.3.4", user = Some "username", pass = Some
|
||||
"password" }
|
||||
, layers.default
|
||||
let T = ./types.dhall
|
||||
|
||||
in { mqtt_servers.default
|
||||
=
|
||||
{ default_mapping = Mapping.Print "no mapping!"
|
||||
{ host = "1.2.3.4", user = Some "username", pass = Some "password" }
|
||||
, layers.default
|
||||
=
|
||||
{ default_mapping = T.Action.Print "no mapping!"
|
||||
, mappings =
|
||||
let sometopic = "homeassistant/switch/something/set"
|
||||
|
||||
in { key_0 =
|
||||
Mapping.Trigger (Action.MQTTPub { topic = sometopic, payload = "ON" })
|
||||
T.Mapping.Trigger
|
||||
(T.Action.MQTTPub { topic = sometopic, payload = "ON" })
|
||||
, key_1 =
|
||||
Mapping.Trigger
|
||||
(Action.MQTTPub { topic = sometopic, payload = "OFF" })
|
||||
T.Mapping.Trigger
|
||||
(T.Action.MQTTPub { topic = sometopic, payload = "OFF" })
|
||||
, key_2 =
|
||||
T.Mapping.TriggerMulti
|
||||
[ T.Action.Print "Doing a thing"
|
||||
, T.Action.MQTTPub
|
||||
{ topic = "thing/foo/bar", payload = "boop" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue