Skip to content

Commit

Permalink
Fixed deprecation warning for device_state_attributes property.
Browse files Browse the repository at this point in the history
  • Loading branch information
boralyl committed Jan 9, 2022
1 parent 6709a5c commit fafa443
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/nintendo_wishlist/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
2 changes: 1 addition & 1 deletion custom_components/nintendo_wishlist/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ def state(self):
return len(matches)

@property
def device_state_attributes(self):
def extra_state_attributes(self):
return self.attrs
2 changes: 1 addition & 1 deletion tests/test_binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fafa443

Please sign in to comment.