-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Be more lenient with config file #289
Comments
Could you be more specific about what values exactly do you want there to be defaults for? The minimum required config is already pretty small:
You can see all of the possible fields here - most of them are already either an As for the fan curve map keys - I would like to keep them as numbers, since this way they can be directly deserialized into a map with integer keys as it is used for fan control. Adding support for string keys would mean that the curve would first have to be deserialized into an intermediate map that have an abstract value as the key, and then converted/parsed into integers. This isn't too hard, but being able to store the things such as the fan curve directly like this was one of the main reasons why the config file uses YAML in the first place, and I don't want to add more ambiguity to the config format. |
@Atemu any thoughts on this? |
Thanks for the ping; this got lost in the endless sea of tabs ;) By "defaults" I mean the default config file generated by the daemon on first startup. I assume these are defined in code somewhere. daemon:
log_level: warning
On a theoretical level, I'd prefer integer keys too but the big problem with them is that barely any tooling supports them. For automatically generating the config file, I had to resort to converting to JSON and then back to YAML using a tool that has a special flag for converting number strings to integers (yj/jy): This is a rather hammer-like approach and will try to convert any key that looks like a number. Is there not a way to coerce strings into numbers while de-serialising? Not familiar with the library you're using for that purpose. |
The current config file format is very strict. Defaults must be present and the keys of the curve dict must be integers.
Both of these requirements cause considerable complexity when automating deployment of this service which I did in the form of a NixOS module that I plan to upstream.
It'd be great if lactd could assume the defaults if the config file does not include them and allow string representations of temperature number keys.
The text was updated successfully, but these errors were encountered: