Commit Graph
100 Commits
Author SHA1 Message Date
Dreaded_X db2170b84e feat: Sync printer light with room light
Build and deploy / build (push) Successful in 19m57s
Build and deploy / Deploy container (push) Has been skipped
2026-06-19 06:02:07 +02:00
Dreaded_X 903887a149 feat: Add basic support for bambu printer 2026-06-19 06:02:03 +02:00
Dreaded_X 79ac49041d feat: Build fully static binary 2026-06-19 06:01:44 +02:00
Dreaded_X 9979ab3446 fix: Deploy requires login now
Build and deploy / build (push) Successful in 15m9s
Build and deploy / Deploy container (push) Successful in 1m20s
2026-05-12 05:52:39 +02:00
Dreaded_X b66357749b chore: Update dependencies 2026-05-12 05:52:38 +02:00
Dreaded_X 5a2c1b0a13 feat: Added automation for wardrobe light 2026-05-12 04:27:46 +02:00
Dreaded_X ccd9460e76 chore: Update README to use prek 2026-05-12 04:27:16 +02:00
Dreaded_X 00c32e8993 feat: Added all_on function to HueGroup 2026-05-12 04:26:42 +02:00
Dreaded_X 8c6adae3ae fix: Chef cook uses wrong toolchain
Build and deploy / build (push) Successful in 10m28s
Build and deploy / Deploy container (push) Successful in 40s
This adds a toolchain setup step to the base image so we do not have to
do it multiple times
2025-11-20 04:44:25 +01:00
Dreaded_X 2158bde1c2 chore: Upgraded to new workflow 2025-11-20 04:44:25 +01:00
Dreaded_X b547f66d86 feat: Added 3d printer to guest room
Build and deploy / build (push) Successful in 17m17s
Build and deploy / Deploy container (push) Successful in 3m19s
2025-11-16 16:37:12 +01:00
Dreaded_X f3de8e36ea fix: Frontdoor presence is the wrong way around
Build and deploy / build (push) Successful in 14m48s
Build and deploy / Deploy container (push) Successful in 1m59s
2025-10-30 20:56:49 +01:00
Dreaded_X 44f2c57819 fix: Set entrypoint lua path correctly in Dockerfile
Build and deploy / build (push) Successful in 11m27s
Build and deploy / Deploy container (push) Successful in 29s
2025-10-22 05:17:02 +02:00
Dreaded_X ad158f2c22 feat: Reduced visibility of config structs
Build and deploy / build (push) Successful in 9m0s
Build and deploy / Deploy container (push) Successful in 49s
2025-10-22 04:13:54 +02:00
Dreaded_X f36adf2f19 feat: Implement useful traits to simplify code 2025-10-22 04:09:01 +02:00
Dreaded_X 5947098bfb chore: Fix config type annotations
Build and deploy / build (push) Successful in 12m30s
Build and deploy / Deploy container (push) Has been skipped
2025-10-22 03:59:59 +02:00
Dreaded_X 8a3143a3ea feat: Added type alias for setup and schedule types 2025-10-22 03:59:40 +02:00
Dreaded_X 9546585440 feat(config)!: Made schedule part of new modules
Build and deploy / build (push) Successful in 11m57s
Build and deploy / Deploy container (push) Has been skipped
2025-10-22 03:24:34 +02:00
Dreaded_X a938f3d71b feat(config)!: Improve config module resolution
Build and deploy / build (push) Successful in 11m31s
Build and deploy / Deploy container (push) Has been skipped
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.
2025-10-22 03:09:15 +02:00
Dreaded_X a6c19eb9b4 fix: Fix issues with inner type definitions 2025-10-22 02:59:21 +02:00
Dreaded_X 7db628709a refactor: Split config
Build and deploy / build (push) Successful in 10m56s
Build and deploy / Deploy container (push) Has been skipped
2025-10-20 05:02:19 +02:00
Dreaded_X bc75f7005c 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.
2025-10-20 05:02:04 +02:00
Dreaded_X 2056c6c70d feat(config)!: Changed default config location 2025-10-20 04:48:33 +02:00
Dreaded_X 2fe9fbadfb feat(config)!: Remove device manager lua code
With the recent changes the device manager no longer needs to be
available in lua.
2025-10-20 04:48:33 +02:00
Dreaded_X 2db4af7427 feat(config)!: Config now returns the mqtt config instead of the client
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.
2025-10-20 04:48:32 +02:00
Dreaded_X 7b7279017f refactor: Restructured config to not rely on mqtt client being available
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.
2025-10-20 04:48:29 +02:00
Dreaded_X f05856cd0c feat(config)!: In config devices can now also be a (table of) function(s)
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.
2025-10-20 04:48:28 +02:00
Dreaded_X 02b6cf12a1 feat: Improved device conversion error message 2025-10-20 04:48:28 +02:00
Dreaded_X 02b87126e1 feat: Use ActionCallback for schedule
This has two advantages:
- Each schedule entry can take either a single function or table of
  functions.
- We get a better type definition.
2025-10-20 04:48:28 +02:00
Dreaded_X 1ffccd955c refactor(config)!: Move scheduler out of device_manager
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.
2025-10-20 04:48:28 +02:00
Dreaded_X 948380ea9b feat: Receive devices through config return 2025-10-20 04:48:28 +02:00
Dreaded_X 0c80cef5a1 feat: Ensure consistent ordering device definitions 2025-10-20 04:48:28 +02:00
Dreaded_X 84e8942fc9 feat: Generate definitions for config 2025-10-20 04:48:27 +02:00
Dreaded_X b557afe2fc refactor: Move definition writing into separate function 2025-10-20 04:48:27 +02:00
Dreaded_X 5801421378 refactor: Move main.rs to bin/automation.rs 2025-10-20 04:48:22 +02:00
Dreaded_X ba818c6b60 refactor(config)!: Setup for expanding lua config return
Moves the application config out of automation_lib and sets up the
config return type for further expansion.
2025-10-17 03:08:21 +02:00
Dreaded_X a95574b731 feat: Added type annotations to config.lua
Build and deploy / build (push) Successful in 9m16s
Build and deploy / Deploy container (push) Successful in 3m12s
In some instances this required some restructuring of the code to be
able to properly add the annotations.
2025-10-15 04:24:08 +02:00
Dreaded_X 810fae8da5 chore: Reordered pre-commit hooks 2025-10-15 04:23:12 +02:00
Dreaded_X 6fc3783d7a feat: Added lua definition files
Also added a pre-commit hook to ensure that the definitions files are
up-to-date.
2025-10-15 04:23:12 +02:00
Dreaded_X df64804b00 feat: Add bin to automatically generate lua definitions 2025-10-15 04:01:15 +02:00
Dreaded_X 11b9787890 chore: Remove allow that is no longer required 2025-10-15 03:57:57 +02:00
Dreaded_X 8961101fdf chore: Run main application by default 2025-10-15 03:57:02 +02:00
Dreaded_X 17a68e8991 feat: Added optional definition function to module 2025-10-15 03:53:55 +02:00
Dreaded_X be1602d0e2 feat(config)!: Move mqtt module to actual separate module
The automation:mqtt module now gets loaded in a similar way as the
automation:devices and automation:utils modules.
This leads to a breaking change where instantiating a new mqtt client
the device manager needs to be explicitly passed in.
2025-10-15 03:53:55 +02:00
Dreaded_X 9bddeae54e feat: Use Typed::type_name for Timeout proxy name 2025-10-15 03:53:06 +02:00
Dreaded_X 97b944874a feat: Added/expanded Typed impls 2025-10-15 03:50:50 +02:00
Dreaded_X 54164c517b feat: Remove automatic automation: module prefix
Instead the prefix should be manually specified if it is desired.
2025-10-15 03:50:36 +02:00
Dreaded_X 518abd169d chore: Removed dotenvy
Since secrets can now be set from automation.toml the .env file was no
longer used, so dotenvy can be removed.
2025-10-15 03:44:17 +02:00
Dreaded_X 30ea9b2737 feat: Use Typed type_name for registering proxy 2025-10-15 03:44:17 +02:00
Dreaded_X cd470cadaf feat!: Expanded add_methods to extra_user_data
Instead of being a function it now expects a struct with the
PartialUserData trait implemented. This in part ensures the correct
function signature.

It also adds another optional function to PartialUserData that returns
definitions for the added methods.
2025-10-15 03:44:17 +02:00
Dreaded_X 4b76bde2a6 feat: Specify (optional) interface name in PartialUserData 2025-10-15 03:44:17 +02:00
Dreaded_X 006a561307 feat: Use PartialUserData on proxy type to add trait methods 2025-10-15 03:44:17 +02:00
Dreaded_X 745a1025bb feat!: Improved attribute parsing in device macro 2025-10-15 03:44:13 +02:00
Dreaded_X 45485fca37 feat: Add proper type definition for devices
Depending on the implemented traits the lua class will inherit from the
associated interface class.

It also specifies the constructor function for each of the devices.
2025-10-15 00:45:37 +02:00
Dreaded_X 1532958a86 feat: Added Typed impl for all automation devices
To accomplish this a basic implementation was also provided for some
types in automation_lib
2025-10-15 00:45:37 +02:00
Dreaded_X 76eb63cd97 feat: Use same add_methods mechanic for Device as for other traits
Build and deploy / build (push) Successful in 9m57s
Build and deploy / Deploy container (push) Has been skipped
2025-10-10 03:33:28 +02:00
Dreaded_X b784cfed4a feat: Notify when windows are left open when leaving
Build and deploy / build (push) Successful in 15m2s
Build and deploy / Deploy container (push) Successful in 2m8s
2025-10-10 01:12:58 +02:00
Dreaded_X 06b3154733 feat!: Use type alias instead of generic parameters in device macro
Build and deploy / build (push) Successful in 10m11s
Build and deploy / Deploy container (push) Successful in 2m8s
This enforced the idea that all generics must be specified for the type
when using the device macro. It will also come into play later when the
Typed macro gets introduced, as the name will be used when generating
definitions.
2025-09-17 00:35:30 +02:00
Dreaded_X 580a5187bd feat!: Made ntfy notification title required
Build and deploy / build (push) Successful in 12m26s
Build and deploy / Deploy container (push) Successful in 43s
2025-09-13 04:04:51 +02:00
Dreaded_X 8982e9c165 feat(config)!: Put automation modules in namespace
Build and deploy / build (push) Successful in 13m33s
Build and deploy / Deploy container (push) Successful in 39s
All lua modules that originate from automation_rs are now prefixed with
`automation:`.
2025-09-11 04:12:15 +02:00
Dreaded_X 4e28ad0f85 feat!: Improve device type registration
Build and deploy / build (push) Successful in 10m37s
Build and deploy / Deploy container (push) Successful in 38s
Instead of one function that contains all the device types available in
`automation_devices` a global registry is used were each device can
register itself.
2025-09-10 03:02:05 +02:00
Dreaded_X f0e4c9dd21 chore!: Remove unused notification setters
Since the creation of notifications has moved entirely to lua these
setters were not being used anymore.
2025-09-10 02:56:56 +02:00
Dreaded_X 5271e5ad81 refactor(config)!: Moved Timeout into utils module and moved module
Build and deploy / build (push) Successful in 10m43s
Build and deploy / Deploy container (push) Successful in 39s
The module is now setup in automation_lib::lua::utils.
2025-09-10 02:11:11 +02:00
Dreaded_X 1d28b43264 refactor: Move module load code into separate function 2025-09-10 02:11:11 +02:00
Dreaded_X da04fad520 refactor(config)!: Move device proxies into module
Instead of registering the device proxies in the global namespace they
are now registered in a module called `devices`.
2025-09-10 02:11:09 +02:00
Dreaded_X 84e4b30b6a feat!: Improve lua module registration
Instead of having to call all the module registration functions in one
place it is possible for each module to register itself in a global registry.
During startup all the all the modules will be registered
automatically.

This does currently have one weakness, to need to ensure that the crate
is linked.
2025-09-10 02:10:45 +02:00
Dreaded_X 95a8a377e8 feat!: Removed AddAdditionalMethods
It has been replaced with the add_methods device attribute.
2025-09-10 01:58:48 +02:00
Dreaded_X 23355190ca feat: Added attribute to easily register additional lua methods
Previously this could only be done by implementing a trait, like
`AddAdditionalMethods`, that that has an add_methods function where you
can put your custom methods. With this new attribute you can pass in a
register function directly!
2025-09-10 01:58:48 +02:00
Dreaded_X 2dbd491b81 refactor!: Rewrote device implementation macro once again
This time with a bit more though put into the design of the code, as a
result the macro should be a lot more robust.

This did result in the macro getting renamed from LuaDevice to Device as
this should be _the_ Device macro.
The attribute also got renamed from traits() to device(traits()) and the
syntax got overhauled to allow for a bit more expression.
2025-09-10 01:58:48 +02:00
Dreaded_X aad089aa10 chore: Removed old leftover contact sensor presence config 2025-09-10 01:46:16 +02:00
Dreaded_X 18e40726fe refactor: Remove unneeded wrapper functions when specifying callbacks
These wrappers can be moved up to where the callback itself is defined
instead of having to wrap the call manually. This also works a lot nicer
now that it is possible to provide multiple callback functions.
2025-09-10 01:46:16 +02:00
Dreaded_X 1925bac73c fix: Front door presence does not get cleared properly 2025-09-10 01:46:16 +02:00
Dreaded_X 5383e7265d feat!: ActionCallback can now receive any amount of arguments
ActionCallback now only has one generics argument that has to implement
IntoLuaMulti, this makes ActionCallback much more flexible as it no
longer always requires two arguments.
2025-09-10 01:46:12 +02:00
Dreaded_X 352654107a feat: Added derive macro to implement IntoLua on structs that implement Serialize
This can be very useful if you want to convert a data struct to a lua
table without having to write the boilerplane (however small it may
be).

It also adds the macro on several state structs so they can be
converted to lua in the upcoming ActionCallback refactor.
2025-09-08 04:06:00 +02:00
Dreaded_X 3a7f2f9bd7 fix: IkeaRemote callback is missing default specifier 2025-09-08 04:05:43 +02:00
Dreaded_X 3be11b0c6a feat: Allow for multiple callbacks inside of an ActionCallback
This also results in the conversion being performed when the
ActionCallback is instantiated instead of when it is called, this should
make it easier to catch errors.
2025-09-08 04:02:47 +02:00
Dreaded_X e880efe4cf refactor: Store callback function directly instead of in the registry 2025-09-08 04:02:47 +02:00
Dreaded_X e2fb680cd6 feat: Log version string during startup 2025-09-08 04:02:40 +02:00
Dreaded_X edee032b91 chore: Set RUST_LOG to something sensible by default when running with cargo
Build and deploy / Deploy container (push) Blocked by required conditions
Build and deploy / build (push) Has been cancelled
2025-09-05 04:48:00 +02:00
Dreaded_X 8bb17e1440 feat(config)!: Reworked how configuration is loaded
The environment variable `AUTOMATION_CONFIG` has been renamed to
`AUTOMATION__ENTRYPOINT` and can now also be set in `automation.toml` by
specifying:
```
automation = "<path>"
```

Directly accessing the environment variables in lua in no longer
possible. To pass in configuration or secrets you can now instead make
use of the `variables` and `secrets` modules.

To set values in these modules you can either specify them in
`automation.toml`:
```
[variables]
<name> = <value>

[secrets]
<name> = <value>
```
Note that these values will get converted to a string.

You can also specify the environment variables
`AUTOMATION__VARIABLES__<name>` and `AUTOMATION__SECRETS__<name>` to
set variables and secrets respectively. By adding the suffix `__FILE` to
the environment variable name the contents of a file can be loaded into
the variable or secret.

Note that variables and secrets are identical in functionality and the
name difference exists purely to make it clear that secret values are
meant to be kept secret.
2025-09-05 04:48:00 +02:00
Dreaded_X ba37de3939 feat(config)!: Move new_mqtt_client out of global automation table into separate module
The function `new_mqtt_client` was the last remaining entry in the
global `automation` table. The function was renamed to `new` and placed
in the new `mqtt` module. As `automation` is now empty, it has been
removed.
2025-09-05 03:55:04 +02:00
Dreaded_X 22fee0ed77 feat(config)!: Move device_manager out of global automation table into separate module
Moved `automation.device_manager` into a separate module called
`device_manager`
2025-09-05 03:55:03 +02:00
Dreaded_X 5aebab28ed feat(config)!: Move util out of global automation table into separate module
Move `automation.util` into a separate module called `utils`.
2025-09-05 03:55:03 +02:00
Dreaded_X e626caad8a feat(config)!: Fulfillment config is now returned at the end of the config
Previously the fulfillment config was set by setting
`automation.fulfillment`, this will no longer work in the future when
the global automation gets split into modules.
2025-09-05 03:55:03 +02:00
Dreaded_X 0090a77dc1 style: Sort crates by name 2025-09-05 03:55:03 +02:00
Dreaded_X 4d356001c3 style: Enforce conventional commits formatting 2025-09-05 03:55:03 +02:00
Dreaded_X aa22132dd6 chore: Put typos config in Cargo.toml 2025-09-04 04:28:02 +02:00
Dreaded_X 1db269f65e chore: Update pre-commit hooks 2025-09-04 04:28:02 +02:00
Dreaded_X 77d7881a57 chore: Update/upgrade dependencies
There was a potential vulnerability in tracing-subscriber, so I took
this as an opportunity to update/upgrade all dependencies
2025-09-04 04:28:02 +02:00
Dreaded_X f3b1854beb fix: Crash if hallway automation is called before door/trash have been initialized
Resolves: #4
2025-09-04 04:27:49 +02:00
Dreaded_X 8109dcf2f5 feat: Added low battery notification and made mqtt message parsing more robust
Resolves: #1
2025-09-04 04:26:34 +02:00
Dreaded_X 1b8566e593 refactor: Switch to async closures 2025-09-04 04:15:08 +02:00
Dreaded_X e21ea0f34e Implement custom lua print function that calls info
Build and deploy / build (push) Successful in 11m54s
Build and deploy / Deploy container (push) Successful in 45s
2025-09-01 02:47:47 +02:00
Dreaded_X fb7e1f1472 Small cleanup 2025-09-01 02:47:29 +02:00
Dreaded_X 45de83ef2f Removed old presence system 2025-08-31 23:57:59 +02:00
Dreaded_X 2a1f75f158 Move front door presence logic to lua 2025-08-31 23:57:59 +02:00
Dreaded_X 74568b4e1f Handle turning off devices when away through lua 2025-08-31 23:57:59 +02:00
Dreaded_X fefccf03d7 Removed DebugBridge as it no longer served a purpose 2025-08-31 23:57:59 +02:00
Dreaded_X b56a16d0d7 Moved presence debug mqtt message to lua 2025-08-31 23:57:59 +02:00
Dreaded_X 1530875045 Presence and light sensor call all function in array 2025-08-31 23:57:58 +02:00