Skip to content

Commit 175582c

Browse files
committed
Rename device_state_attributes to extra_state_attributes.
This change was made in HA 2021.4, but only started issuing deprecation warnings in 2021.12.
1 parent 60ddbcd commit 175582c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

custom_components/metlink/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def device_class(self):
181181
return SensorDeviceClass.TIMESTAMP
182182

183183
@property
184-
def device_state_attributes(self) -> Dict[str, Any]:
184+
def extra_state_attributes(self) -> Dict[str, Any]:
185185
return self.attrs
186186

187187
async def async_update(self):

tests/test_sensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async def test_async_update_success(hass, aioclient_mock):
138138
}
139139

140140
assert expected == sensor.attrs
141-
assert expected == sensor.device_state_attributes
141+
assert expected == sensor.extra_state_attributes
142142
assert sensor.available is True
143143
assert sensor.icon == "mdi:train"
144144
assert sensor.name == "Metlink WELL"
@@ -213,7 +213,7 @@ async def test_async_update_multiple(hass, aioclient_mock):
213213
}
214214

215215
assert expected == sensor.attrs
216-
assert expected == sensor.device_state_attributes
216+
assert expected == sensor.extra_state_attributes
217217
assert sensor.available is True
218218
assert sensor.icon == "mdi:train"
219219
assert sensor.name == "Metlink WELL"

0 commit comments

Comments
 (0)