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:
@@ -9,12 +9,14 @@ local FulfillmentConfig
|
||||
|
||||
---@class Config
|
||||
---@field fulfillment FulfillmentConfig
|
||||
---@field devices Devices?
|
||||
---@field modules Modules?
|
||||
---@field mqtt MqttConfig
|
||||
---@field schedule table<string, fun() | fun()[]>?
|
||||
local Config
|
||||
|
||||
---@alias Devices (DeviceInterface | fun(client: AsyncClient): Devices)[]
|
||||
---@alias SetupFunction fun(mqtt_client: AsyncClient): SetupTable?
|
||||
---@alias SetupTable (DeviceInterface | { setup: SetupFunction? } | SetupTable)[]
|
||||
---@alias Modules SetupFunction | SetupTable
|
||||
|
||||
---@class MqttConfig
|
||||
---@field host string
|
||||
|
||||
Reference in New Issue
Block a user