feat(config)!: Improve config module resolution
Some checks are pending
Build and deploy / build (push) Waiting to run
Build and deploy / Deploy container (push) Blocked by required conditions

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:
2025-10-22 03:03:38 +02:00
parent a6c19eb9b4
commit e333881844
5 changed files with 145 additions and 67 deletions

View File

@@ -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