angelnu / home_assistant_thethingsnetwork

TheThingsNetwork v3 integration for Home Assistant
33 stars 8 forks source link

deprecated device_state_attributes #2

Closed ei-ke closed 2 years ago

ei-ke commented 2 years ago

From the log:

2021-12-20 11:22:15 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.attnode_001_v (<class 'custom_components.thethingsnetwork.TTN_client.TtnDataSensor'>) implements device_state_attributes. Please report it to the custom component author.

I've changed def device_state_attributes(self) -> Optional[Dict[str, Any]]: to def extra_state_attributes(self) -> Optional[Dict[str, Any]]: on L469

Not sure if that's the solution, but the warning is gone.

angelnu commented 2 years ago

Likely device_state_attributes has been deprecated in favor of extra_state_attributes.

Will take your change - thanks!

angelnu commented 2 years ago

Fixed with https://github.com/angelnu/home_assistant_thethingsnetwork/commit/6b034c1da40caa2ecc8dfb8089da2c5a1b4a57a8