diff --git a/dashboard/src/ui.rs b/dashboard/src/ui.rs index 7b9500d..fc8d6a3 100644 --- a/dashboard/src/ui.rs +++ b/dashboard/src/ui.rs @@ -46,11 +46,12 @@ pub fn apply_theme(app: &AppWindow, entities: &Vec) { if entity.entity_id == "sensor.diyless_thermostat_3_ambient_light_level" && let Ok(illuminance) = entity.state.parse::() { - let color_scheme = if illuminance < 250 { - ColorScheme::Dark - } else { - ColorScheme::Light - }; + let mut color_scheme = app.get_color_scheme(); + if illuminance < 250 { + color_scheme = ColorScheme::Dark; + } else if illuminance > 300 { + color_scheme = ColorScheme::Light; + } app.set_color_scheme(color_scheme); }