feat(config)!: In config devices can now also be a (table of) function(s)

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 02b6cf12a1
commit f05856cd0c
5 changed files with 86 additions and 7 deletions

View File

@@ -9,6 +9,9 @@ local FulfillmentConfig
---@class Config
---@field fulfillment FulfillmentConfig
---@field devices DeviceInterface[]?
---@field devices Devices?
---@field mqtt AsyncClient
---@field schedule table<string, fun() | fun()[]>?
local Config
---@alias Devices (DeviceInterface | fun(client: AsyncClient): Devices)[]