Migrate attribution attribute for bbox (#57650)

This commit is contained in:
Franck Nijhof 2021-10-14 10:23:54 +02:00 committed by GitHub
parent debcdc382f
commit 1dcba44199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,6 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
)
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_MONITORED_VARIABLES,
CONF_NAME,
DATA_RATE_MEGABITS_PER_SECOND,
@ -117,7 +116,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
class BboxUptimeSensor(SensorEntity):
"""Bbox uptime sensor."""
_attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION}
_attr_attribution = ATTRIBUTION
_attr_device_class = DEVICE_CLASS_TIMESTAMP
def __init__(self, bbox_data, name, description: SensorEntityDescription):
@ -138,7 +137,7 @@ class BboxUptimeSensor(SensorEntity):
class BboxSensor(SensorEntity):
"""Implementation of a Bbox sensor."""
_attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION}
_attr_attribution = ATTRIBUTION
def __init__(self, bbox_data, name, description: SensorEntityDescription):
"""Initialize the sensor."""