diff --git a/custom_components/nintendo_wishlist/binary_sensor.py b/custom_components/nintendo_wishlist/binary_sensor.py index 53fa0c8..eec8eaf 100644 --- a/custom_components/nintendo_wishlist/binary_sensor.py +++ b/custom_components/nintendo_wishlist/binary_sensor.py @@ -77,5 +77,5 @@ def name(self) -> str: return self.game_title @property - def device_state_attributes(self): + def extra_state_attributes(self): return {"matches": self.matches} diff --git a/custom_components/nintendo_wishlist/sensor.py b/custom_components/nintendo_wishlist/sensor.py index 588456c..e1ff282 100644 --- a/custom_components/nintendo_wishlist/sensor.py +++ b/custom_components/nintendo_wishlist/sensor.py @@ -56,5 +56,5 @@ def state(self): return len(matches) @property - def device_state_attributes(self): + def extra_state_attributes(self): return self.attrs diff --git a/tests/test_binary_sensor.py b/tests/test_binary_sensor.py index 5b70483..2b317a1 100644 --- a/tests/test_binary_sensor.py +++ b/tests/test_binary_sensor.py @@ -23,4 +23,4 @@ def test_static_properties(coordinator_mock): assert "on sale" == entity.unit_of_measurement assert "mdi:nintendo-switch" == entity.icon assert "Aggelos" == entity.name - assert {"matches": []} == entity.device_state_attributes + assert {"matches": []} == entity.extra_state_attributes