Skip to content

Commit

Permalink
Fix deprecated device_state_attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkristian committed Dec 28, 2021
1 parent 9e7e393 commit 4fafc19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/wasteplan_trv/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
],
"requirements": [],
"iot_class": "cloud_polling",
"version": "1.0.0"
"version": "1.0.1"
}
10 changes: 8 additions & 2 deletions custom_components/wasteplan_trv/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
import requests
import voluptuous as vol

from .const import ATTRIBUTION, CONF_PICKUP_DAY, CONF_PICKUP_ID, URL, WASTE_TYPES
from .const import (
ATTRIBUTION,
CONF_PICKUP_ID,
CONF_PICKUP_DAY,
WASTE_TYPES,
URL,
)

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -92,7 +98,7 @@ def icon(self):
return self._icon

@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return other details about the sensor state."""
self.attrs["next_pickup_week"] = self._next_pickup_week
self.attrs["pickup_this_week"] = self._pickup_this_week
Expand Down

0 comments on commit 4fafc19

Please sign in to comment.