feat: add configuration handler#129
Conversation
|
Hi @tnemoz thank you for this PR. I will start the review shortly. |
|
Hey @Doomsk! I've just pushed a fix that:
Tell me if there's something I've missed! |
Doomsk
left a comment
There was a problem hiding this comment.
It's taking good shape! A few more comments that I would like your opinion on before giving the green light
|
Hey @Doomsk! I've just pushed a commit related to our previous discussion. Notably:
I've hesitated to make Tell me what you think! |
|
Thanks! @tnemoz |
I did wonder about this! My first thought was that the On the other hand, a
I'm not sure to see the problem here. I'm not sure to see in which instances a user could want to access the
Upon creation, be it from the |
|
@tnemoz that's a tricky point. The use does not have access to it, but the compiler does. The point is: how to define priority? by order of insertion? some defined value by whoever add a new device? Then how to avoid priority collisions (or just append one after the other with same values)? |
|
Hey @Doomsk ! I've added a small docstring to the |
Done! Thanks for the guidance throughout! |
Fixes #63. A
basemodule has been added toconfig. This module contains theConfigstruct, which is to be used to read and write TOML configuration files using itsto_fileandfrom_filemethods respectively. Devices are ordered according to whether they are active or not, and thenewandfrom_filemethods do check that at least one active device is present.Note that I'm not entirely sure that this is what's expected for this issue, so don't hesitate to tell me what should be added/removed/changed!
Concerning the LLM use, VS Code autocomplete gave me
reverseandfindwhich I did not know about (I would have went for a less idiomatic code without it). The rest comes from me, thetomlcrate documentation, and SO because I never had to read from and write to files in Rust 😄Generative AI/LLM disclosure
Code and Logic Architecture/Design:
Code content:
Code review:
Code tests: