Massive config overhaul #6

Merged
Dreaded_X merged 23 commits from feature/improve_config into master 2025-10-22 02:17:46 +00:00
Owner

This implements a massive overhaul to the config system to make it more modular.

It also splits the existing config apart into smaller parts.

This implements a massive overhaul to the config system to make it more modular. It also splits the existing config apart into smaller parts.
Dreaded_X added 23 commits 2025-10-22 02:16:29 +00:00
Moves the application config out of automation_lib and sets up the
config return type for further expansion.
Due to changes made in mlua the new scheduler is much simpler. It also
had no real business being part of the device manager, so it has now been
moved to be part of the returned config.
This has two advantages:
- Each schedule entry can take either a single function or table of
  functions.
- We get a better type definition.
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.
In preparation of changes to the mqtt client the config is rewritten to
use a device creation function for devices that need the mqtt client.

This also fixes a but where hallway_top_light was not actually added to
the device manager.
Instead the client is now created on the rust side based on the config.
Devices that require the mqtt client will now instead need to be
constructor using a function. This function receives the mqtt client.
With the recent changes the device manager no longer needs to be
available in lua.
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.
refactor: Split config
All checks were successful
Build and deploy / build (push) Successful in 10m56s
Build and deploy / Deploy container (push) Has been skipped
7db628709a
feat(config)!: Improve config module resolution
All checks were successful
Build and deploy / build (push) Successful in 11m31s
Build and deploy / Deploy container (push) Has been skipped
a938f3d71b
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.
feat(config)!: Made schedule part of new modules
All checks were successful
Build and deploy / build (push) Successful in 11m57s
Build and deploy / Deploy container (push) Has been skipped
9546585440
chore: Fix config type annotations
All checks were successful
Build and deploy / build (push) Successful in 12m30s
Build and deploy / Deploy container (push) Has been skipped
5947098bfb
feat: Reduced visibility of config structs
All checks were successful
Build and deploy / build (push) Successful in 9m0s
Build and deploy / Deploy container (push) Successful in 49s
ad158f2c22
Dreaded_X merged commit ad158f2c22 into master 2025-10-22 02:17:46 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Dreaded_X/automation_rs#6