Skip to content

Commit 810a714

Browse files
committed
Updated for HA 2022.2.6 compatibilty
device_state_attributes replaced with extra_state_attributes
1 parent b788ad6 commit 810a714

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

custom_components/intellicenter/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def __init__(
224224
self._controller = controller
225225
self._poolObject = poolObject
226226
self._available = True
227-
self._extraStateAttributes = extraStateAttributes
227+
self._extra_state_attributes = extraStateAttributes
228228
self._name = name
229229
self._attribute_key = attribute_key
230230
self._enabled_by_default = enabled_by_default
@@ -314,7 +314,7 @@ def device_info(self):
314314
}
315315

316316
@property
317-
def device_state_attributes(self) -> Optional[Dict[str, Any]]:
317+
def extra_state_attributes(self) -> Optional[Dict[str, Any]]:
318318
"""Return the state attributes of the entity."""
319319

320320
object = self._poolObject
@@ -328,7 +328,7 @@ def device_state_attributes(self) -> Optional[Dict[str, Any]]:
328328
if object.status:
329329
attributes["Status"] = object.status
330330

331-
for attribute in self._extraStateAttributes:
331+
for attribute in self._extra_state_attributes:
332332
if object[attribute]:
333333
attributes[attribute] = object[attribute]
334334

custom_components/intellicenter/light.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __init__(
9191
"""Initialize."""
9292
super().__init__(entry, controller, poolObject)
9393
# USE appears to contain extra info like color...
94-
self._extraStateAttributes = [USE_ATTR]
94+
self._extra_state_attributes = [USE_ATTR]
9595

9696
self._features = 0
9797

custom_components/intellicenter/switch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class PoolBody(PoolCircuit):
107107
def __init__(self, entry: ConfigEntry, controller, poolObject):
108108
"""Initialize a Pool body from the underlying circuit."""
109109
super().__init__(entry, controller, poolObject)
110-
self._extraStateAttributes = [VOL_ATTR, HEATER_ATTR, HTMODE_ATTR]
110+
self._extra_state_attributes = [VOL_ATTR, HEATER_ATTR, HTMODE_ATTR]
111111

112112
@property
113113
def icon(self):

custom_components/intellicenter/water_heater.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ def __init__(
9494
self._lastHeater = self._poolObject[HEATER_ATTR]
9595

9696
@property
97-
def device_state_attributes(self) -> Optional[Dict[str, Any]]:
97+
def extra_state_attributes(self) -> Optional[Dict[str, Any]]:
9898
"""Return the state attributes of the entity."""
9999

100-
state_attributes = super().device_state_attributes
100+
state_attributes = super().extra_state_attributes
101101

102102
if self._lastHeater != NULL_OBJNAM:
103103
state_attributes[self.LAST_HEATER_ATTR] = self._lastHeater

0 commit comments

Comments
 (0)