-
Notifications
You must be signed in to change notification settings - Fork 41
Make the intervall of the sensor fan configurable and the poll timer of properties. #97
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?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR makes the sensor fan polling interval and property poll timer configurable for Xiaomi Mi Air Purifier 3C devices. The motivation is to reduce noise and wear on the sensor fan by allowing users to control how frequently the sensor is activated.
Key Changes
- Added configurable poll interval for property updates (previously hardcoded to 60 seconds)
- Added configurable heartbeat interval and value for sensor fan control
- Made all timing parameters configurable through the YAML configuration
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| components/miot/miot.h | Added setter methods and member variables for poll_interval, heartbeat_value, and heartbeat_interval configuration |
| components/miot/miot.cpp | Updated setup() to use configurable intervals instead of hardcoded 60000ms values |
| components/miot/init.py | Added configuration schema entries and initialization code for the new configurable parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
I tried it now on my C3 and it works well. |
|
Now the Values takes affect also without flashing new. |
I have my Xiaomi-Mi-Air-Purifier-3C in my bedroom and the fan of the sensor is quite loud and also the fan gets very fast bad when it is running 24/7 i know that because i have many of such little fans running for pi cluster as example.
So i make the intervall time in which is the sensor gets readed configurable and i saw that the poll rate of properties is also fix at 60s so i make that also in the same way configurable. with that code it should be possible to controll it like
that should run the pm2.5 sensor for 10s every 30s as example.