Commit Graph

22 Commits

Author SHA1 Message Date
06b3154733 feat!: Use type alias instead of generic parameters in device macro
All checks were successful
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
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
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
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
1b8566e593 refactor: Switch to async closures 2025-09-04 04:15:08 +02:00
5d342afb1f Converted macro to derive macro 2025-08-31 03:54:20 +02:00
d2b01123b8 Made the impl_device macro more explicit about the implemented traits
This also converts impl_device into a procedural macro and get rid of a
lot of "magic" that was happening.
2025-08-31 00:38:58 +02:00
c5262dcf35 Update to rust 1.89 and edition 2024 2025-08-31 00:38:58 +02:00
eefb476d7f Added support for generic structs in LuaDeviceConfig 2024-12-08 01:53:04 +01:00
8877b24e84 Reorganized project 2024-12-08 00:15:03 +01:00
ae2c27551f Initial upgrade to mlua 0.10
All checks were successful
Build and deploy / Build application (push) Successful in 7m59s
Build and deploy / Build container (push) Successful in 2m54s
Build and deploy / Deploy container (push) Successful in 19s
2024-11-30 04:47:52 +01:00
98ab265fed Improved Lua macro situation
All checks were successful
Build and deploy / Build application (push) Successful in 6m20s
Check / Run checks (push) Successful in 2m19s
Build and deploy / Build container (push) Successful in 1m16s
Build and deploy / Deploy container (push) Has been skipped
2024-07-25 00:49:10 +02:00
758500a071 Cleanup 2024-07-09 00:00:00 +02:00
9aa16e3ef8 Started actually using the google home trait macro 2024-07-09 00:00:00 +02:00
d84ff8ec8e Initial google home trait macro 2024-07-08 23:59:59 +02:00
44a40d4dfa LuaDevice macro now uses LuaDeviceCreate trait to create devices from configs 2024-05-07 00:05:37 +02:00
3e4ea8952a Improved how devices are created, ntfy and presence are now treated like any other device 2024-05-07 00:05:36 +02:00
20feaa6308 Slight macro cleanup 2024-05-07 00:05:36 +02:00
55237a2ba2 Improved the internals of the LuaDeviceConfig macro and improve the
usability of the macro
2024-05-07 00:05:36 +02:00
a2ee2ad71d Added rename option to macro 2024-05-07 00:05:36 +02:00
f4a1b507e5 Everything needed to construct a new device is passed in through lua 2024-05-07 00:05:36 +02:00
bfc73c7bd3 Device config is now done through lua 2024-05-07 00:05:36 +02:00