mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 13:27:09 +00:00
Migrate attribution attribute for Aftership (#57649)
This commit is contained in:
parent
f43bba8cfd
commit
2ec352ce96
@ -11,7 +11,7 @@ from homeassistant.components.sensor import (
|
||||
PLATFORM_SCHEMA as BASE_PLATFORM_SCHEMA,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME, HTTP_OK
|
||||
from homeassistant.const import CONF_API_KEY, CONF_NAME, HTTP_OK
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
@ -109,6 +109,7 @@ async def async_setup_platform(
|
||||
class AfterShipSensor(SensorEntity):
|
||||
"""Representation of a AfterShip sensor."""
|
||||
|
||||
_attr_attribution = ATTRIBUTION
|
||||
_attr_native_unit_of_measurement: str = "packages"
|
||||
_attr_icon: str = ICON
|
||||
|
||||
@ -191,7 +192,6 @@ class AfterShipSensor(SensorEntity):
|
||||
_LOGGER.debug("Ignoring %s as it has status: %s", name, status)
|
||||
|
||||
self._attributes = {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
**status_counts,
|
||||
ATTR_TRACKINGS: trackings,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user