feat(config)!: Device creation function is now named entry

It now has to be called 'setup', this makes it possible to just
include the table as a whole in devices and it will automatically call
the correct function.
This commit is contained in:
2025-10-20 04:08:55 +02:00
parent 2056c6c70d
commit bc75f7005c
6 changed files with 41 additions and 27 deletions

View File

@@ -312,6 +312,7 @@ local bedroom_air_filter = devices.AirFilter.new({
url = "http://10.0.0.103",
})
--- @type SetupFunction
local function create_devs(mqtt_client)
on_presence:add(function(presence)
mqtt_client:send_message(mqtt_automation("debug") .. "/presence", {
@@ -749,8 +750,8 @@ return {
openid_url = "https://login.huizinga.dev/api/oidc",
},
mqtt = mqtt_config,
devices = {
create_devs,
modules = {
setup = create_devs,
ntfy,
hue_bridge,
kitchen_lights,