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 Setup?
|
||||
---@field mqtt MqttConfig
|
||||
---@field schedule table<string, fun() | fun()[]>?
|
||||
local Config
|
||||
|
||||
---@alias Devices (DeviceInterface | fun(client: AsyncClient): Devices)[]
|
||||
---@alias SetupFunction fun(mqtt_client: AsyncClient): SetupInner?
|
||||
---@alias SetupInner (DeviceInterface | { setup: SetupFunction } | SetupInner)[]
|
||||
---@alias Setup SetupFunction | SetupInner
|
||||
|
||||
---@class MqttConfig
|
||||
---@field host string
|
||||
|
||||
Reference in New Issue
Block a user