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
|
let T = ./types.dhall
|
||||||
"password" }
|
|
||||||
, layers.default
|
|
||||||
=
|
|
||||||
{ default_mapping = Mapping.Print "no mapping!"
|
|
||||||
, mappings =
|
|
||||||
let sometopic = "homeassistant/switch/something/set"
|
|
||||||
|
|
||||||
in { key_0 =
|
in { mqtt_servers.default
|
||||||
Mapping.Trigger (Action.MQTTPub { topic = sometopic, payload = "ON" })
|
=
|
||||||
, key_1 =
|
{ host = "1.2.3.4", user = Some "username", pass = Some "password" }
|
||||||
Mapping.Trigger
|
, layers.default
|
||||||
(Action.MQTTPub { topic = sometopic, payload = "OFF" })
|
=
|
||||||
}
|
{ default_mapping = T.Action.Print "no mapping!"
|
||||||
}
|
, mappings =
|
||||||
}
|
let sometopic = "homeassistant/switch/something/set"
|
||||||
|
|
||||||
|
in { key_0 =
|
||||||
|
T.Mapping.Trigger
|
||||||
|
(T.Action.MQTTPub { topic = sometopic, payload = "ON" })
|
||||||
|
, key_1 =
|
||||||
|
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