feat(config)!: Improve config module resolution
The new system is slightly less flexible, but the code and lua definitions is now a lot simpler and easier to understand. In fact the old lua definition was not actually correct. It is likely that existing configs require not/minimal tweaks to work again.
This commit is contained in:
@@ -9,14 +9,16 @@ local FulfillmentConfig
|
||||
|
||||
---@class Config
|
||||
---@field fulfillment FulfillmentConfig
|
||||
---@field modules (Modules)?
|
||||
---@field modules (Module)[]
|
||||
---@field mqtt MqttConfig
|
||||
---@field schedule (table<string, fun() | fun()[]>)?
|
||||
local Config
|
||||
|
||||
---@alias SetupFunction fun(mqtt_client: AsyncClient): SetupTable?
|
||||
---@alias SetupTable (DeviceInterface | { setup: SetupFunction? } | SetupTable)[]
|
||||
---@alias Modules SetupFunction | SetupTable
|
||||
---@class Module
|
||||
---@field setup (fun(mqtt_client: AsyncClient): Module | DeviceInterface[] | nil)?
|
||||
---@field devices (DeviceInterface)[]?
|
||||
---@field [number] (Module)[]?
|
||||
local Module
|
||||
|
||||
---@class MqttConfig
|
||||
---@field host string
|
||||
|
||||
Reference in New Issue
Block a user