Skip to content

Commit

Permalink
Add compatibility for ONE thermostat (#72)
Browse files Browse the repository at this point in the history
Added support for ONE thermostat as device subtype 12
Modified def current_humidity to return non in case of ONE
  • Loading branch information
Just-inc-ace committed May 4, 2024
1 parent 3fa5796 commit 81b3434
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/comelit/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def current_temperature(self):

@property
def current_humidity(self):
return self._state['measured_humidity']
return self._state.get('measured_humidity', None)

@property
def supported_features(self):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/comelit/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ def update_entities(self, elements):
elif HubClasses.TEMPERATURE in id:
description = item[HubFields.DESCRIPTION]
self.update_sensor(id, description, item)
# skip creating the climate sensor for the PT100 sensor
if HubFields.SUB_TYPE in item and item["sub_type"] == 16:
# skip creating the climate sensor for the PT100 sensor and add compatibility for ONE
if HubFields.SUB_TYPE in item and (item["sub_type"] == 16 or item["sub_type"] == 12):# skip creating the climate sensor for the PT100 sensor
self.update_climate(id, description, item)
elif HubClasses.LIGHT in id:
description = item[HubFields.DESCRIPTION]
Expand Down

0 comments on commit 81b3434

Please sign in to comment.