-
Notifications
You must be signed in to change notification settings - Fork 75
defro drx pluse #156
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?
defro drx pluse #156
Conversation
…ch entities - Implemented number controls for recuperation systems, including party mode, speed configurations, filter alarms, and ventilation parameters. - Added select controls for fan modes and gear settings with Polish language support. - Introduced a flow balancing switch for managing airflow in recuperation systems. - Enhanced logging for better debugging and tracking of state changes.
…handling; update Tech class headers to include User-Agent
Enhance RecuperationEfficiencySensor with improved logging and error …
Thanks for the PR. Some big changes here. I had to update the main with some fixes and devenv updates to check the PR.
|
…d to TileFanEntity
Refactor import statements for flow constants and add get_state metho…
Now should be ok |
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.
I have looked in fast way into this (without going into logic and deep review) so left few comments
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.
this shouldnt be added
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.
shouldnt be here
entities.append(TileFanSensor(tile, coordinator, config_entry)) | ||
# Check if this fan is handled by the fan platform (recuperation) | ||
description = tile[CONF_PARAMS].get(CONF_DESCRIPTION, "").lower() | ||
if not any(keyword in description for keyword in ["recuperation", "rekuperacja", "ventilation", "wentylacja"]): |
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.
this looks some bad assumption, tech api currently supports:
Available values : en, fr, it, es, nl, pl, de, cs, sk, hu, ro, lt, et, ru, si, hr
so assuming it will not work for other languages properly and we have a lot of users using those languages
|
||
# Direct gear control settings | ||
GEAR_CONTROL_IDO_ID = 1833 | ||
GEAR_OPTIONS = { |
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.
be consistent and use english for comments everywhere
@property | ||
def is_on(self) -> bool | None: | ||
"""Return True if filter replacement is needed.""" | ||
# Calculate if filter replacement is needed based on usage days |
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.
What is source of max days and other constants?
Does device record them or what will happen when those will be passed?
for flow_sensor in [RECUPERATION_EXHAUST_FLOW, RECUPERATION_SUPPLY_FLOW, RECUPERATION_SUPPLY_FLOW_ALT]: | ||
if flow_sensor["txt_id"] == widget_txt_id: | ||
flow_value = widget_data.get("value", 0) | ||
if flow_value and flow_value > 0: |
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.
we dont need to check flow_value exists as above you always make it using:
flow_value = widget_data.get("value", 0)
|
||
# Define options with Polish names | ||
self._attr_options = [ | ||
"Zatrzymaj wentylator", |
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.
We should support all languages from tech API as minimum:
Options: 'en', 'fr', 'it', 'es', 'nl', 'pl', 'de', 'cs', 'sk', 'hu', 'ro', 'lt', 'et', 'ru', 'si', 'hr'
As we got a users from those countries also
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.
Yes, this is all in the language file returned by the API:
https://emodul.eu/api/v1/i18n/en
https://emodul.eu/api/v1/i18n/pl
so you need to use the key/value from there
|
||
# Map option name to value | ||
option_value_map = { | ||
"Zatrzymaj wentylator": 0, |
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.
We should not use only Polish
async def async_select_option(self, option: str) -> None: | ||
"""Change the selected gear.""" | ||
gear_mapping = { | ||
"Zatrzymaj": 0, |
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.
Not only Polish
self.headers = { | ||
"Accept": "application/json", | ||
"Accept-Encoding": "gzip", | ||
"User-Agent": "TechController/1.0 (Home Assistant Integration)" |
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.
it is hard to tell how tech company will react on that, this will give them chance to cut off this integration very easy by blocking this header
Summary
This pull request introduces comprehensive support for Tech HVAC recuperation (ventilation) systems within the Home Assistant integration. It adds new binary sensors to monitor filter replacement and system status, introduces button entities for controlling recuperation features (filter reset, party mode, quick boost), and extends the integration's constants and platform support to handle these new capabilities.
Recuperation System Support
binary_sensor.py
andbutton.py
.New Entities for Recuperation Control and Monitoring
FilterReplacementSensor
for filter replacement needs.RecuperationSystemStatusSensor
for operational system status.FilterResetButton
PartyModeButton
QuickBoostButton
Platform and Constants Extension
Platform.FAN
Platform.NUMBER
Platform.SELECT
Platform.BUTTON
Platform.SWITCH
Integration and State Management
These changes enhance the integration’s ability to monitor and control recuperation units, giving users improved diagnostics and direct control over key ventilation features.