Add gamma control and night light (#38)
Add configurable night light, smooth gamma transitions, and shell controls. Update documentation and panel tests, and fix portal test startup synchronization.
This commit is contained in:
1 parent
9163374cdb
commit
2a400b26d0
34 files changed
+940
-20
No files matched your search
@@ -1,6 +1,7 @@
|
||||
pub mod activities;
|
||||
pub mod families;
|
||||
pub mod file;
|
||||
pub mod night_light;
|
||||
pub mod notifications;
|
||||
pub use ferese_panel::panel;
|
||||
pub mod presets;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct Settings {
|
||||
pub enabled: bool,
|
||||
pub temperature: u16,
|
||||
}
|
||||
|
||||
impl Default for Settings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
temperature: 4500,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Settings {
|
||||
pub fn validate(self) -> Result<Self, String> {
|
||||
if !(1000..=6500).contains(&self.temperature) {
|
||||
return Err("night-light temperature must be between 1000 and 6500 K".into());
|
||||
}
|
||||
Ok(self)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user