Skip to content

Commit

Permalink
Added availability status
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Jan 4, 2022
1 parent 6aa29cf commit dd01ce4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/thermia/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def __init__(self, coordinator, idx):
super().__init__(coordinator)
self.idx = idx

@property
def available(self):
"""Return True if entity is available."""
return self.coordinator.data.heat_pumps[self.idx].is_online

@property
def name(self):
"""Return the name of the sensor."""
Expand Down
5 changes: 5 additions & 0 deletions custom_components/thermia/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def __init__(self, coordinator, idx):
super().__init__(coordinator)
self.idx = idx

@property
def available(self):
"""Return True if entity is available."""
return self.coordinator.data.heat_pumps[self.idx].is_online

@property
def name(self):
"""Return the name of the water heater."""
Expand Down

0 comments on commit dd01ce4

Please sign in to comment.