Add new getters/setters for %RH and CO₂ sensor control, heating adjust mode, and defrost mode.#71
Conversation
- New settables: - A_CYC_<HOME|AWAY|BOOST>_RH_CTRL_ENABLED - A_CYC_<HOME|AWAY|BOOST>_CO2_CTRL_ENABLED - A_CYC_CO2_THRESHOLD - A_CYC_RH_LEVEL_MODE - A_CYC_RH_BASIC_LEVEL - A_CYC_PARTIAL_BYPASS - A_CYC_SUPPLY_HEATING_ADJUST_MODE - A_CYC_POST_HEATER_WINTER_SETPOINT - A_CYC_COOLRECOVERY_DISABLED - A_CYC_DEFROST_MODE - A_CYC_SUPPLY_AIR_DEFROST_TEMP - These all correspond to options available in the Vallox web GUI. - New enums: - CellState - SupplyHeatingAdjustMode - DefrostMode - New helpers: - MetricData::supply_heating_adjust_mode() - MetricData::get_supply_heating_adjust_mode() - MetricData::get_supply_heating_adjust_mode_name() - MetricData::defrost_mode() - MetricData::get_defrost_mode() - MetricData::get_defrost_mode_name() - MetricData::get_rh_sensor_control() - MetricData::get_co2_sensor_control() - MetricData::get_rh_sensor_control_mode() - MetricData::get_rh_sensor_limit() - MetricData::get_co2_sensor_limit() - Vallox::set_rh_sensor_control() - Vallox::set_co2_sensor_control() - Vallox::set_rh_sensor_control_mode() - Vallox::set_rh_sensor_limit() - Vallox::set_co2_sensor_limit() - Vallox::set_supply_heating_adjust_mode() - Vallox::set_defrost_mode() Note: I also have a commit for the HA Vallox component ready that will expose all these as switches/numbers/selects and also create more sensors for other data that is displayed in the Vallox web GUI.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #71 +/- ##
==========================================
+ Coverage 87.88% 88.81% +0.93%
==========================================
Files 7 7
Lines 553 635 +82
==========================================
+ Hits 486 564 +78
- Misses 67 71 +4 ☔ View full report in Codecov by Sentry. |
|
Hi @karrenberg, I am glad to see your interest in improving this project. I am happy to help. Did the review. Take a look. |
Thanks for the review @yozik04, much appreciated! I'll make the changes as soon as I find the time. |
vallox_websocket_api/vallox.py
Outdated
| @property | ||
| def rh_sensor_control_mode(self) -> Optional[int]: | ||
| """Return the RH sensor control mode (0 for automatic, 1 for manual)""" | ||
| return self.get(SET_RH_SENSOR_CONTROL_MODE) |
There was a problem hiding this comment.
The last thing that bothers me. Do we want to use enum here or we will make it boolean?
There was a problem hiding this comment.
Oh yeah, good point. I don't have a preference, but int is clearly not a good choice :).
There was a problem hiding this comment.
Ok. I changed the name and made it boolean
|
@karrenberg Thank you for the effort. Really appreciated. |
|
BTW: |
It's a refactor to get rid of the hardcoded values in the Vallox HA component: I believe that ideally all hardcoded values should be abstracted by the websocket API. It's a bit overkill for all the A_CYC_ constants, but things like these integer values that correspond to specific settings should be kept behind the API interface. |
|
But let's make a property that will return |
Thanks a lot for the quick responses, the detailed review and your fixes! Very much looking forward to merging the HA changes to make use of the new stuff :). Sneak peek without any GUI efforts (ignore the weird defrost sensors, I was trying to find some more of the settings exposed in Vallox' web GUI): |
|
Nice. I have released 5.4.0. |
Hi! First pull request for me, please help me get this right :).
Thank you for your work on the websocket API! It's really awesome to be able to hack on this myself instead of relying on proprietary stuff. I hope I can contribute back with this.
I tried to make this as clean as possible. Of course it makes much more sense with the Home Assistant side of things - I also have a commit for the HA Vallox component ready that will expose all these settables as switches/numbers/selects and also create more sensors for other data that is displayed in the Vallox web GUI. It only needs a bit of cleanup before it will go up for review, too. All settables have been tested in production to match what the web GUI does. There are a few more that I couldn't quite identify, e.g. some obscure defrost settings with offset/param pairs that I couldn't make sense of (value mismatches between Vallox GUI and API readouts).
New settables:
These all correspond to options available in the Vallox web GUI.
New enums:
New helpers: