feat(config)!: In config devices can now also be a (table of) function(s)
Some checks failed
Build and deploy / Deploy container (push) Blocked by required conditions
Build and deploy / build (push) Has been cancelled

This function receives the mqtt client as an argument. In the future
this will be the only way to create devices that require the mqtt client.
This commit is contained in:
2025-10-19 04:18:26 +02:00
parent 88a7acd55d
commit a26a93550b
5 changed files with 86 additions and 7 deletions

View File

@@ -742,11 +742,15 @@ devs:add(devices.ContactSensor.new({
battery_callback = check_battery,
}))
-- HACK: If the devices config contains a function it will call it so we have to remove it
devs.add = nil
---@type Config
return {
fulfillment = {
openid_url = "https://login.huizinga.dev/api/oidc",
},
mqtt = mqtt_client,
devices = devs,
schedule = {
["0 0 19 * * *"] = function()