Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Commit 8e98344

Browse files
committed
Fix _attr_available definition
1 parent ba6719e commit 8e98344

File tree

1 file changed

+2
-2
lines changed
  • custom_components/apsystemsapi_local

1 file changed

+2
-2
lines changed

custom_components/apsystemsapi_local/sensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async def async_setup_entry(
102102
class BaseSensor(SensorEntity):
103103
"""Representation of an APsystem sensor."""
104104

105-
_attr_available = False
105+
_attr_available = True
106106

107107
def __init__(
108108
self, api: APsystemsEZ1M, device_name: str, sensor_name: str, sensor_id: str
@@ -141,7 +141,7 @@ async def async_update_data(self):
141141
try:
142142
data = await self._api.get_output_data()
143143
self.update_state(data)
144-
self._attr_available = False
144+
self._attr_available = True
145145
except (client_exceptions.ClientConnectionError, asyncio.TimeoutError):
146146
self._attr_available = False
147147

0 commit comments

Comments
 (0)