diff --git a/homeassistant/components/flipr/sensor.py b/homeassistant/components/flipr/sensor.py index f9fd4e9633e..0d986114659 100644 --- a/homeassistant/components/flipr/sensor.py +++ b/homeassistant/components/flipr/sensor.py @@ -57,6 +57,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities): class FliprSensor(FliprEntity, SensorEntity): """Sensor representing FliprSensor data.""" + _attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION} + @property def name(self): """Return the name of the particular component.""" @@ -84,8 +86,3 @@ class FliprSensor(FliprEntity, SensorEntity): def native_unit_of_measurement(self): """Return unit of measurement.""" return SENSORS[self.info_type]["unit"] - - @property - def device_state_attributes(self): - """Return device attributes.""" - return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/gogogate2/sensor.py b/homeassistant/components/gogogate2/sensor.py index a9be18d06a6..7ad248b88d6 100644 --- a/homeassistant/components/gogogate2/sensor.py +++ b/homeassistant/components/gogogate2/sensor.py @@ -121,7 +121,7 @@ class DoorSensorTemperature(GoGoGate2Entity, SensorEntity): return TEMP_CELSIUS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" door = self._get_door() if door.sensorid is not None: diff --git a/homeassistant/components/group/media_player.py b/homeassistant/components/group/media_player.py index 810959609b5..b7db9fa9631 100644 --- a/homeassistant/components/group/media_player.py +++ b/homeassistant/components/group/media_player.py @@ -205,7 +205,7 @@ class MediaGroup(MediaPlayerEntity): return False @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Return the state attributes for the media group.""" return {ATTR_ENTITY_ID: self._entities} diff --git a/homeassistant/components/nws/sensor.py b/homeassistant/components/nws/sensor.py index 85b60ffd475..4be99f95c19 100644 --- a/homeassistant/components/nws/sensor.py +++ b/homeassistant/components/nws/sensor.py @@ -55,6 +55,7 @@ class NWSSensor(CoordinatorEntity, SensorEntity): """An NWS Sensor Entity.""" entity_description: NWSSensorEntityDescription + _attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION} def __init__( self, @@ -95,11 +96,6 @@ class NWSSensor(CoordinatorEntity, SensorEntity): return round(value) return value - @property - def device_state_attributes(self): - """Return the attribution.""" - return {ATTR_ATTRIBUTION: ATTRIBUTION} - @property def unique_id(self): """Return a unique_id for this entity.""" diff --git a/homeassistant/components/plaato/const.py b/homeassistant/components/plaato/const.py index 1700b803775..2d8cf40c91e 100644 --- a/homeassistant/components/plaato/const.py +++ b/homeassistant/components/plaato/const.py @@ -26,7 +26,7 @@ UNDO_UPDATE_LISTENER = "undo_update_listener" DEFAULT_SCAN_INTERVAL = 5 MIN_UPDATE_INTERVAL = timedelta(minutes=1) -DEVICE_STATE_ATTRIBUTES = { +EXTRA_STATE_ATTRIBUTES = { "beer_name": "beer_name", "keg_date": "keg_date", "mode": "mode", diff --git a/homeassistant/components/plaato/entity.py b/homeassistant/components/plaato/entity.py index a28dfefb567..3c04c5d597d 100644 --- a/homeassistant/components/plaato/entity.py +++ b/homeassistant/components/plaato/entity.py @@ -7,9 +7,9 @@ from .const import ( DEVICE, DEVICE_ID, DEVICE_NAME, - DEVICE_STATE_ATTRIBUTES, DEVICE_TYPE, DOMAIN, + EXTRA_STATE_ATTRIBUTES, SENSOR_DATA, SENSOR_SIGNAL, ) @@ -73,7 +73,7 @@ class PlaatoEntity(entity.Entity): if self._attributes: return { attr_key: self._attributes[plaato_key] - for attr_key, plaato_key in DEVICE_STATE_ATTRIBUTES.items() + for attr_key, plaato_key in EXTRA_STATE_ATTRIBUTES.items() if plaato_key in self._attributes and self._attributes[plaato_key] is not None }