-
Notifications
You must be signed in to change notification settings - Fork 7
add-night-mode-functionality #4
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
base: main
Are you sure you want to change the base?
add-night-mode-functionality #4
Conversation
Co-authored-by: apo-mak <25563515+apo-mak@users.noreply.github.com>
|
Seems like the switch to toggle off the pm sensor does not work, did you test it? |
yes and i thought that it works. |
|
I tested .turn_on() and .turn_off() for the display and it didn't work. I was able to create a switch in the UI that toggles the contrast between 0% and 40% which has a similar effect. I'm just about to create a PR for this now. |
|
Very strange because it works here on my Ultimate Sensor turning on and off the display |
it works on my end, especially the "night mode. |
|
@dwainscheeren is it ok to merge this pr ? |
|
Let me check, there are now 2 PR's for the same thing :P Let me check what is the best I can do and merge it. |
Quick note, the other PR is only for the display. So if you go with the other one, please copy the “PM turn off” part of the code ( and or the night switch for the Home Assistant) |
|
Yes but esphome released an update with also sps30 idle mode now :) so need to look into that also |
This pull request introduces new switch controls and configuration improvements to all four
ultimatesensor-v1YAML files, enhancing user control over the OLED display, PM sensor, and adding a night mode feature. The changes improve modularity and allow users to enable/disable hardware features dynamically.Switch Controls and Feature Toggles:
lcd_display_switch) in all variants, allowing users to turn the display on or off via software. ([[1]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-a3770364b76f54f220ce4aaacea9e29ed3565ed2bf44624610833693d617bda9R847-R860),[[2]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-8c709a45ae1fcc1c41cba43ff0ea2a90aa3820fb34e655e332429506c56a2316R850-R863),[[3]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-eee30ec6755c8a53ad71061a470d33e686ca0bda6707cb407cb2c522e455b334R914-R958),[[4]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-88da9783ffb25c7106ab4ecb1b9db30e14cabc15050b8b30b08f635b7391bc2dR887-R931))pm_sensor_switch) in the "complete" variants, enabling dynamic activation or deactivation of the sensor and its update interval. ([[1]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-eee30ec6755c8a53ad71061a470d33e686ca0bda6707cb407cb2c522e455b334R914-R958),[[2]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-88da9783ffb25c7106ab4ecb1b9db30e14cabc15050b8b30b08f635b7391bc2dR887-R931))[[1]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-eee30ec6755c8a53ad71061a470d33e686ca0bda6707cb407cb2c522e455b334R914-R958),[[2]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-88da9783ffb25c7106ab4ecb1b9db30e14cabc15050b8b30b08f635b7391bc2dR887-R931))Sensor and Display Configuration:
id: oled_display) in all YAML files, enabling direct reference and control from other components. ([[1]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-a3770364b76f54f220ce4aaacea9e29ed3565ed2bf44624610833693d617bda9R90),[[2]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-8c709a45ae1fcc1c41cba43ff0ea2a90aa3820fb34e655e332429506c56a2316R93),[[3]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-eee30ec6755c8a53ad71061a470d33e686ca0bda6707cb407cb2c522e455b334R108),[[4]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-88da9783ffb25c7106ab4ecb1b9db30e14cabc15050b8b30b08f635b7391bc2dR90))id: pm_sensor) in the "complete" variants for easier management and integration with switches. ([[1]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-eee30ec6755c8a53ad71061a470d33e686ca0bda6707cb407cb2c522e455b334R170),[[2]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-88da9783ffb25c7106ab4ecb1b9db30e14cabc15050b8b30b08f635b7391bc2dR151))Global State Management:
pm_sensor_enabled) in the "complete" variants to persist the enabled/disabled state of the PM sensor across restarts. ([[1]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-eee30ec6755c8a53ad71061a470d33e686ca0bda6707cb407cb2c522e455b334R353-R356),[[2]](https://github.com/smarthomeshop/ultimatesensor/pull/4/files#diff-88da9783ffb25c7106ab4ecb1b9db30e14cabc15050b8b30b08f635b7391bc2dR334-R337))