Skip to content

Commit

Permalink
Disable operation mode feature if it is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Aug 9, 2024
1 parent 41b13be commit d30e5dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions custom_components/thermia/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ def operation_list(self):
@property
def supported_features(self):
"""Return the list of supported features."""
return (
WaterHeaterEntityFeature.TARGET_TEMPERATURE
| WaterHeaterEntityFeature.OPERATION_MODE
)
features = WaterHeaterEntityFeature.TARGET_TEMPERATURE

if self.current_operation is not None:
features |= WaterHeaterEntityFeature.OPERATION_MODE

return features

async def async_set_temperature(self, **kwargs):
"""Set new target temperature."""
Expand Down

0 comments on commit d30e5dd

Please sign in to comment.