diff --git a/homeassistant/components/abode/__init__.py b/homeassistant/components/abode/__init__.py index 47e03eea44c6..c1c89951c3f8 100644 --- a/homeassistant/components/abode/__init__.py +++ b/homeassistant/components/abode/__init__.py @@ -363,7 +363,7 @@ class AbodeDevice(AbodeEntity): return self._device.name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, @@ -411,7 +411,7 @@ class AbodeAutomation(AbodeEntity): return self._automation.name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION, "type": "CUE automation"} diff --git a/homeassistant/components/abode/alarm_control_panel.py b/homeassistant/components/abode/alarm_control_panel.py index c508d0f02408..6d0c030e3e1e 100644 --- a/homeassistant/components/abode/alarm_control_panel.py +++ b/homeassistant/components/abode/alarm_control_panel.py @@ -69,7 +69,7 @@ class AbodeAlarm(AbodeDevice, alarm.AlarmControlPanelEntity): self._device.set_away() @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, diff --git a/homeassistant/components/accuweather/sensor.py b/homeassistant/components/accuweather/sensor.py index 90058e254dcd..aa7f604e27f8 100644 --- a/homeassistant/components/accuweather/sensor.py +++ b/homeassistant/components/accuweather/sensor.py @@ -141,7 +141,7 @@ class AccuWeatherSensor(CoordinatorEntity): return SENSOR_TYPES[self.kind][self._unit_system] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self.forecast_day is not None: if self.kind in ["WindDay", "WindNight", "WindGustDay", "WindGustNight"]: diff --git a/homeassistant/components/aemet/abstract_aemet_sensor.py b/homeassistant/components/aemet/abstract_aemet_sensor.py index 6b7c3c69fee3..7699a5f99a49 100644 --- a/homeassistant/components/aemet/abstract_aemet_sensor.py +++ b/homeassistant/components/aemet/abstract_aemet_sensor.py @@ -52,6 +52,6 @@ class AbstractAemetSensor(CoordinatorEntity): return self._unit_of_measurement @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/aftership/sensor.py b/homeassistant/components/aftership/sensor.py index 2d9021f80095..754b3ce72eb4 100644 --- a/homeassistant/components/aftership/sensor.py +++ b/homeassistant/components/aftership/sensor.py @@ -134,7 +134,7 @@ class AfterShipSensor(Entity): return "packages" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return attributes for the sensor.""" return self._attributes diff --git a/homeassistant/components/agent_dvr/camera.py b/homeassistant/components/agent_dvr/camera.py index 571b5239de7c..7904f98216b2 100644 --- a/homeassistant/components/agent_dvr/camera.py +++ b/homeassistant/components/agent_dvr/camera.py @@ -108,7 +108,7 @@ class AgentCamera(MjpegCamera): self._removed = True @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the Agent DVR camera state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, diff --git a/homeassistant/components/airly/air_quality.py b/homeassistant/components/airly/air_quality.py index 4c4c239a84b5..f89a804ab3bc 100644 --- a/homeassistant/components/airly/air_quality.py +++ b/homeassistant/components/airly/air_quality.py @@ -117,7 +117,7 @@ class AirlyAirQuality(CoordinatorEntity, AirQualityEntity): } @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" attrs = { LABEL_AQI_DESCRIPTION: self.coordinator.data[ATTR_API_CAQI_DESCRIPTION], diff --git a/homeassistant/components/airly/sensor.py b/homeassistant/components/airly/sensor.py index 789dbbb46570..dae167559e0f 100644 --- a/homeassistant/components/airly/sensor.py +++ b/homeassistant/components/airly/sensor.py @@ -102,7 +102,7 @@ class AirlySensor(CoordinatorEntity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._attrs diff --git a/homeassistant/components/airnow/sensor.py b/homeassistant/components/airnow/sensor.py index 4488098701f1..ea2ff9856fb1 100644 --- a/homeassistant/components/airnow/sensor.py +++ b/homeassistant/components/airnow/sensor.py @@ -84,7 +84,7 @@ class AirNowSensor(CoordinatorEntity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self.kind == ATTR_API_AQI: self._attrs[SENSOR_AQI_ATTR_DESCR] = self.coordinator.data[ diff --git a/homeassistant/components/airvisual/__init__.py b/homeassistant/components/airvisual/__init__.py index e900bfa65de9..6254d533a0fb 100644 --- a/homeassistant/components/airvisual/__init__.py +++ b/homeassistant/components/airvisual/__init__.py @@ -372,7 +372,7 @@ class AirVisualEntity(CoordinatorEntity): self._unit = None @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return self._attrs diff --git a/homeassistant/components/alarmdecoder/alarm_control_panel.py b/homeassistant/components/alarmdecoder/alarm_control_panel.py index 5e3118b1d3df..9cab2afa43cb 100644 --- a/homeassistant/components/alarmdecoder/alarm_control_panel.py +++ b/homeassistant/components/alarmdecoder/alarm_control_panel.py @@ -163,7 +163,7 @@ class AlarmDecoderAlarmPanel(AlarmControlPanelEntity): return self._code_arm_required @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return { "ac_power": self._ac_power, diff --git a/homeassistant/components/alarmdecoder/binary_sensor.py b/homeassistant/components/alarmdecoder/binary_sensor.py index 55bf13d7fef0..4cc3bb6b5cf8 100644 --- a/homeassistant/components/alarmdecoder/binary_sensor.py +++ b/homeassistant/components/alarmdecoder/binary_sensor.py @@ -118,7 +118,7 @@ class AlarmDecoderBinarySensor(BinarySensorEntity): return False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" attr = {CONF_ZONE_NUMBER: self._zone_number} if self._rfid and self._rfstate is not None: diff --git a/homeassistant/components/alpha_vantage/sensor.py b/homeassistant/components/alpha_vantage/sensor.py index 0d0aec47915e..cd161b1870c1 100644 --- a/homeassistant/components/alpha_vantage/sensor.py +++ b/homeassistant/components/alpha_vantage/sensor.py @@ -133,7 +133,7 @@ class AlphaVantageSensor(Entity): return self.values["1. open"] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self.values is not None: return { @@ -193,7 +193,7 @@ class AlphaVantageForeignExchange(Entity): return self._icon @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self.values is not None: return { diff --git a/homeassistant/components/amcrest/camera.py b/homeassistant/components/amcrest/camera.py index a8aabc233d17..046da7b270d8 100644 --- a/homeassistant/components/amcrest/camera.py +++ b/homeassistant/components/amcrest/camera.py @@ -266,7 +266,7 @@ class AmcrestCam(Camera): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the Amcrest-specific camera state attributes.""" attr = {} if self._audio_enabled is not None: diff --git a/homeassistant/components/amcrest/sensor.py b/homeassistant/components/amcrest/sensor.py index 44ebcfcdb956..15a610b23b4e 100644 --- a/homeassistant/components/amcrest/sensor.py +++ b/homeassistant/components/amcrest/sensor.py @@ -66,7 +66,7 @@ class AmcrestSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._attrs diff --git a/homeassistant/components/android_ip_webcam/__init__.py b/homeassistant/components/android_ip_webcam/__init__.py index 905d02628627..54a281feacd1 100644 --- a/homeassistant/components/android_ip_webcam/__init__.py +++ b/homeassistant/components/android_ip_webcam/__init__.py @@ -321,7 +321,7 @@ class AndroidIPCamEntity(Entity): return self._ipcam.available @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" state_attr = {ATTR_HOST: self._host} if self._ipcam.status_data is None: diff --git a/homeassistant/components/androidtv/media_player.py b/homeassistant/components/androidtv/media_player.py index 4d17b4ecdad4..b2a8ceffc9f1 100644 --- a/homeassistant/components/androidtv/media_player.py +++ b/homeassistant/components/androidtv/media_player.py @@ -469,7 +469,7 @@ class ADBDevice(MediaPlayerEntity): return self._available @property - def device_state_attributes(self): + def extra_state_attributes(self): """Provide the last ADB command's response and the device's HDMI input as attributes.""" return { "adb_response": self._adb_response, diff --git a/homeassistant/components/arlo/alarm_control_panel.py b/homeassistant/components/arlo/alarm_control_panel.py index 47328d5cbc22..dd899cbd04ff 100644 --- a/homeassistant/components/arlo/alarm_control_panel.py +++ b/homeassistant/components/arlo/alarm_control_panel.py @@ -136,7 +136,7 @@ class ArloBaseStation(AlarmControlPanelEntity): return self._base_station.name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, diff --git a/homeassistant/components/arlo/camera.py b/homeassistant/components/arlo/camera.py index 36e321817022..c18486614298 100644 --- a/homeassistant/components/arlo/camera.py +++ b/homeassistant/components/arlo/camera.py @@ -108,7 +108,7 @@ class ArloCam(Camera): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return { name: value diff --git a/homeassistant/components/arlo/sensor.py b/homeassistant/components/arlo/sensor.py index d5d583de22c9..1e0c55c5d313 100644 --- a/homeassistant/components/arlo/sensor.py +++ b/homeassistant/components/arlo/sensor.py @@ -183,7 +183,7 @@ class ArloSensor(Entity): self._state = None @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" attrs = {} diff --git a/homeassistant/components/asuswrt/device_tracker.py b/homeassistant/components/asuswrt/device_tracker.py index 385b25755b08..f5cb9b934e30 100644 --- a/homeassistant/components/asuswrt/device_tracker.py +++ b/homeassistant/components/asuswrt/device_tracker.py @@ -103,7 +103,7 @@ class AsusWrtDevice(ScannerEntity): return self._icon @property - def device_state_attributes(self) -> Dict[str, any]: + def extra_state_attributes(self) -> Dict[str, any]: """Return the attributes.""" return self._attrs diff --git a/homeassistant/components/asuswrt/sensor.py b/homeassistant/components/asuswrt/sensor.py index 2751e161ea91..0cd427d3b640 100644 --- a/homeassistant/components/asuswrt/sensor.py +++ b/homeassistant/components/asuswrt/sensor.py @@ -159,7 +159,7 @@ class AsusWrtSensor(CoordinatorEntity): return self._device_class @property - def device_state_attributes(self) -> Dict[str, any]: + def extra_state_attributes(self) -> Dict[str, any]: """Return the attributes.""" return {"hostname": self._router.host} diff --git a/homeassistant/components/atome/sensor.py b/homeassistant/components/atome/sensor.py index 1a8585653fe0..e50f7cd5de65 100644 --- a/homeassistant/components/atome/sensor.py +++ b/homeassistant/components/atome/sensor.py @@ -243,7 +243,7 @@ class AtomeSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._attributes diff --git a/homeassistant/components/august/lock.py b/homeassistant/components/august/lock.py index e16c603d919e..4b4ae906190a 100644 --- a/homeassistant/components/august/lock.py +++ b/homeassistant/components/august/lock.py @@ -105,7 +105,7 @@ class AugustLock(AugustEntityMixin, RestoreEntity, LockEntity): return self._changed_by @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device specific state attributes.""" attributes = {ATTR_BATTERY_LEVEL: self._detail.battery_level} diff --git a/homeassistant/components/august/sensor.py b/homeassistant/components/august/sensor.py index 6004a07f605a..9dba5bb2766f 100644 --- a/homeassistant/components/august/sensor.py +++ b/homeassistant/components/august/sensor.py @@ -166,7 +166,7 @@ class AugustOperatorSensor(AugustEntityMixin, RestoreEntity, Entity): self._entity_picture = lock_activity.operator_thumbnail_url @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device specific state attributes.""" attributes = {} diff --git a/homeassistant/components/aurora/__init__.py b/homeassistant/components/aurora/__init__.py index 044b118b030e..321b25de7b99 100644 --- a/homeassistant/components/aurora/__init__.py +++ b/homeassistant/components/aurora/__init__.py @@ -168,7 +168,7 @@ class AuroraEntity(CoordinatorEntity): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {"attribution": ATTRIBUTION} diff --git a/homeassistant/components/automation/__init__.py b/homeassistant/components/automation/__init__.py index 50b9fc43bf53..24121359ac06 100644 --- a/homeassistant/components/automation/__init__.py +++ b/homeassistant/components/automation/__init__.py @@ -535,7 +535,7 @@ class AutomationEntity(ToggleEntity, RestoreEntity): ) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return automation attributes.""" if self._id is None: return None diff --git a/homeassistant/components/awair/sensor.py b/homeassistant/components/awair/sensor.py index 421fa3d8a26e..d685b3ec17b9 100644 --- a/homeassistant/components/awair/sensor.py +++ b/homeassistant/components/awair/sensor.py @@ -179,7 +179,7 @@ class AwairSensor(CoordinatorEntity): return SENSOR_TYPES[self._kind][ATTR_UNIT] @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Return the Awair Index alongside state attributes. The Awair Index is a subjective score ranging from 0-4 (inclusive) that diff --git a/homeassistant/components/azure_devops/sensor.py b/homeassistant/components/azure_devops/sensor.py index 6f259afb9a97..a26f0c65f9c4 100644 --- a/homeassistant/components/azure_devops/sensor.py +++ b/homeassistant/components/azure_devops/sensor.py @@ -92,7 +92,7 @@ class AzureDevOpsSensor(AzureDevOpsDeviceEntity): return self._state @property - def device_state_attributes(self) -> object: + def extra_state_attributes(self) -> object: """Return the attributes of the sensor.""" return self._attributes diff --git a/homeassistant/components/bayesian/binary_sensor.py b/homeassistant/components/bayesian/binary_sensor.py index 69553e921eba..6879e278bab0 100644 --- a/homeassistant/components/bayesian/binary_sensor.py +++ b/homeassistant/components/bayesian/binary_sensor.py @@ -384,7 +384,7 @@ class BayesianBinarySensor(BinarySensorEntity): return self._device_class @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" attr_observations_list = [ diff --git a/homeassistant/components/bbox/sensor.py b/homeassistant/components/bbox/sensor.py index 13c8f5bb03f0..8d6708c6342a 100644 --- a/homeassistant/components/bbox/sensor.py +++ b/homeassistant/components/bbox/sensor.py @@ -115,7 +115,7 @@ class BboxUptimeSensor(Entity): return self._icon @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} @@ -167,7 +167,7 @@ class BboxSensor(Entity): return self._icon @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/bitcoin/sensor.py b/homeassistant/components/bitcoin/sensor.py index c748b2f72f94..f6f5a24d22ff 100644 --- a/homeassistant/components/bitcoin/sensor.py +++ b/homeassistant/components/bitcoin/sensor.py @@ -110,7 +110,7 @@ class BitcoinSensor(Entity): return ICON @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/blink/alarm_control_panel.py b/homeassistant/components/blink/alarm_control_panel.py index dbcb6d30143a..ed2b46acaa1b 100644 --- a/homeassistant/components/blink/alarm_control_panel.py +++ b/homeassistant/components/blink/alarm_control_panel.py @@ -62,7 +62,7 @@ class BlinkSyncModule(AlarmControlPanelEntity): return f"{DOMAIN} {self._name}" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" attr = self.sync.attributes attr["network_info"] = self.data.networks diff --git a/homeassistant/components/blink/camera.py b/homeassistant/components/blink/camera.py index d4282bed6069..a25b978ee7b0 100644 --- a/homeassistant/components/blink/camera.py +++ b/homeassistant/components/blink/camera.py @@ -60,7 +60,7 @@ class BlinkCamera(Camera): return self._unique_id @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the camera attributes.""" return self._camera.attributes diff --git a/homeassistant/components/blockchain/sensor.py b/homeassistant/components/blockchain/sensor.py index feb9d582cff0..790051dad963 100644 --- a/homeassistant/components/blockchain/sensor.py +++ b/homeassistant/components/blockchain/sensor.py @@ -75,7 +75,7 @@ class BlockchainSensor(Entity): return ICON @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/bluesound/media_player.py b/homeassistant/components/bluesound/media_player.py index 0ace6f5679a2..dff45ca68bd7 100644 --- a/homeassistant/components/bluesound/media_player.py +++ b/homeassistant/components/bluesound/media_player.py @@ -850,7 +850,7 @@ class BluesoundPlayer(MediaPlayerEntity): _LOGGER.error("Master not found %s", master_device) @property - def device_state_attributes(self): + def extra_state_attributes(self): """List members in group.""" attributes = {} if self._group_list: diff --git a/homeassistant/components/bmw_connected_drive/__init__.py b/homeassistant/components/bmw_connected_drive/__init__.py index 3a653ec252f7..ebf1fd6f74ea 100644 --- a/homeassistant/components/bmw_connected_drive/__init__.py +++ b/homeassistant/components/bmw_connected_drive/__init__.py @@ -334,7 +334,7 @@ class BMWConnectedDriveBaseEntity(Entity): } @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return self._attrs diff --git a/homeassistant/components/bmw_connected_drive/binary_sensor.py b/homeassistant/components/bmw_connected_drive/binary_sensor.py index cad5426d5483..bebb55bbde08 100644 --- a/homeassistant/components/bmw_connected_drive/binary_sensor.py +++ b/homeassistant/components/bmw_connected_drive/binary_sensor.py @@ -109,7 +109,7 @@ class BMWConnectedDriveSensor(BMWConnectedDriveBaseEntity, BinarySensorEntity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the binary sensor.""" vehicle_state = self._vehicle.state result = self._attrs.copy() diff --git a/homeassistant/components/bmw_connected_drive/lock.py b/homeassistant/components/bmw_connected_drive/lock.py index 0d281e78f147..97c9be7216b3 100644 --- a/homeassistant/components/bmw_connected_drive/lock.py +++ b/homeassistant/components/bmw_connected_drive/lock.py @@ -52,7 +52,7 @@ class BMWLock(BMWConnectedDriveBaseEntity, LockEntity): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the lock.""" vehicle_state = self._vehicle.state result = self._attrs.copy() diff --git a/homeassistant/components/brother/sensor.py b/homeassistant/components/brother/sensor.py index a379d9b41546..dcbf92fba7df 100644 --- a/homeassistant/components/brother/sensor.py +++ b/homeassistant/components/brother/sensor.py @@ -88,7 +88,7 @@ class BrotherPrinterSensor(CoordinatorEntity): return None @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" remaining_pages = None drum_counter = None diff --git a/homeassistant/components/brottsplatskartan/sensor.py b/homeassistant/components/brottsplatskartan/sensor.py index 7b2c3e585e30..b75edcc7f4ab 100644 --- a/homeassistant/components/brottsplatskartan/sensor.py +++ b/homeassistant/components/brottsplatskartan/sensor.py @@ -99,7 +99,7 @@ class BrottsplatskartanSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._attributes diff --git a/homeassistant/components/brunt/cover.py b/homeassistant/components/brunt/cover.py index ceb56ba03fa7..9c539fe51fe1 100644 --- a/homeassistant/components/brunt/cover.py +++ b/homeassistant/components/brunt/cover.py @@ -131,7 +131,7 @@ class BruntDevice(CoverEntity): return self.move_state == 2 @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the detailed device state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, diff --git a/homeassistant/components/buienradar/sensor.py b/homeassistant/components/buienradar/sensor.py index 4e35542b5812..ae57ed3c43cf 100644 --- a/homeassistant/components/buienradar/sensor.py +++ b/homeassistant/components/buienradar/sensor.py @@ -430,7 +430,7 @@ class BrSensor(Entity): return self._entity_picture @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self.type.startswith(PRECIPITATION_FORECAST): result = {ATTR_ATTRIBUTION: self._attribution} diff --git a/homeassistant/components/caldav/calendar.py b/homeassistant/components/caldav/calendar.py index 66b3c974306e..62be361df3b5 100644 --- a/homeassistant/components/caldav/calendar.py +++ b/homeassistant/components/caldav/calendar.py @@ -123,7 +123,7 @@ class WebDavCalendarEventDevice(CalendarEventDevice): self._offset_reached = False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return {"offset_reached": self._offset_reached} diff --git a/homeassistant/components/canary/alarm_control_panel.py b/homeassistant/components/canary/alarm_control_panel.py index e4dda0f9f336..d0beece8df2c 100644 --- a/homeassistant/components/canary/alarm_control_panel.py +++ b/homeassistant/components/canary/alarm_control_panel.py @@ -87,7 +87,7 @@ class CanaryAlarm(CoordinatorEntity, AlarmControlPanelEntity): return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {"private": self.location.is_private} diff --git a/homeassistant/components/canary/sensor.py b/homeassistant/components/canary/sensor.py index 99dcdf48fced..2d5a7885fbf6 100644 --- a/homeassistant/components/canary/sensor.py +++ b/homeassistant/components/canary/sensor.py @@ -163,7 +163,7 @@ class CanarySensor(CoordinatorEntity, Entity): return self._sensor_type[2] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" reading = self.reading diff --git a/homeassistant/components/cert_expiry/sensor.py b/homeassistant/components/cert_expiry/sensor.py index 0e329b1898f5..582205f9c0de 100644 --- a/homeassistant/components/cert_expiry/sensor.py +++ b/homeassistant/components/cert_expiry/sensor.py @@ -68,7 +68,7 @@ class CertExpiryEntity(CoordinatorEntity): return "mdi:certificate" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return additional sensor state attributes.""" return { "is_valid": self.coordinator.is_cert_valid, diff --git a/homeassistant/components/citybikes/sensor.py b/homeassistant/components/citybikes/sensor.py index 924ef2fa6b4d..2dd60078bd5f 100644 --- a/homeassistant/components/citybikes/sensor.py +++ b/homeassistant/components/citybikes/sensor.py @@ -286,7 +286,7 @@ class CityBikesStation(Entity): break @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self._station_data: return { diff --git a/homeassistant/components/co2signal/sensor.py b/homeassistant/components/co2signal/sensor.py index a61615d0e235..2153a8a7af5b 100644 --- a/homeassistant/components/co2signal/sensor.py +++ b/homeassistant/components/co2signal/sensor.py @@ -91,7 +91,7 @@ class CO2Sensor(Entity): return CO2_INTENSITY_UNIT @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the last update.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/coinbase/sensor.py b/homeassistant/components/coinbase/sensor.py index f191bb778f49..1d239ba457ed 100644 --- a/homeassistant/components/coinbase/sensor.py +++ b/homeassistant/components/coinbase/sensor.py @@ -71,7 +71,7 @@ class AccountSensor(Entity): return CURRENCY_ICONS.get(self._unit_of_measurement, DEFAULT_COIN_ICON) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, @@ -120,7 +120,7 @@ class ExchangeRateSensor(Entity): return CURRENCY_ICONS.get(self.currency, DEFAULT_COIN_ICON) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/comed_hourly_pricing/sensor.py b/homeassistant/components/comed_hourly_pricing/sensor.py index 90830d522367..c1a784f619ca 100644 --- a/homeassistant/components/comed_hourly_pricing/sensor.py +++ b/homeassistant/components/comed_hourly_pricing/sensor.py @@ -97,7 +97,7 @@ class ComedHourlyPricingSensor(Entity): return self._unit_of_measurement @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/command_line/sensor.py b/homeassistant/components/command_line/sensor.py index 3e6f384cca3e..fc99befb8212 100644 --- a/homeassistant/components/command_line/sensor.py +++ b/homeassistant/components/command_line/sensor.py @@ -95,7 +95,7 @@ class CommandSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._attributes diff --git a/homeassistant/components/coronavirus/sensor.py b/homeassistant/components/coronavirus/sensor.py index 7f0e0c230e6c..acfc5569f342 100644 --- a/homeassistant/components/coronavirus/sensor.py +++ b/homeassistant/components/coronavirus/sensor.py @@ -73,6 +73,6 @@ class CoronavirusSensor(CoordinatorEntity): return "people" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/cpuspeed/sensor.py b/homeassistant/components/cpuspeed/sensor.py index df1a224bccef..f21513f616e6 100644 --- a/homeassistant/components/cpuspeed/sensor.py +++ b/homeassistant/components/cpuspeed/sensor.py @@ -54,7 +54,7 @@ class CpuSpeedSensor(Entity): return FREQUENCY_GIGAHERTZ @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self.info is not None: attrs = { diff --git a/homeassistant/components/cups/sensor.py b/homeassistant/components/cups/sensor.py index 72d2aa62ae07..54e674b1811f 100644 --- a/homeassistant/components/cups/sensor.py +++ b/homeassistant/components/cups/sensor.py @@ -131,7 +131,7 @@ class CupsSensor(Entity): return ICON_PRINTER @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" if self._printer is None: return None @@ -193,7 +193,7 @@ class IPPSensor(Entity): return PRINTER_STATES.get(key, key) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" if self._attributes is None: return None @@ -271,7 +271,7 @@ class MarkerSensor(Entity): return PERCENTAGE @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" if self._attributes is None: return None diff --git a/homeassistant/components/currencylayer/sensor.py b/homeassistant/components/currencylayer/sensor.py index f2cb29515b03..66b26eb0692e 100644 --- a/homeassistant/components/currencylayer/sensor.py +++ b/homeassistant/components/currencylayer/sensor.py @@ -86,7 +86,7 @@ class CurrencylayerSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/darksky/sensor.py b/homeassistant/components/darksky/sensor.py index 0bafdbb3d819..7e6463dc08e2 100644 --- a/homeassistant/components/darksky/sensor.py +++ b/homeassistant/components/darksky/sensor.py @@ -620,7 +620,7 @@ class DarkSkySensor(Entity): return None @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} @@ -739,7 +739,7 @@ class DarkSkyAlertSensor(Entity): return "mdi:alert-circle-outline" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._alerts diff --git a/homeassistant/components/deconz/binary_sensor.py b/homeassistant/components/deconz/binary_sensor.py index 616206949edd..99f559eec3d8 100644 --- a/homeassistant/components/deconz/binary_sensor.py +++ b/homeassistant/components/deconz/binary_sensor.py @@ -92,7 +92,7 @@ class DeconzBinarySensor(DeconzDevice, BinarySensorEntity): return DEVICE_CLASS.get(type(self._device)) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" attr = {} diff --git a/homeassistant/components/deconz/climate.py b/homeassistant/components/deconz/climate.py index 44111fbbb1e4..dad3f3adf676 100644 --- a/homeassistant/components/deconz/climate.py +++ b/homeassistant/components/deconz/climate.py @@ -244,7 +244,7 @@ class DeconzThermostat(DeconzDevice, ClimateEntity): return TEMP_CELSIUS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the thermostat.""" attr = {} diff --git a/homeassistant/components/deconz/light.py b/homeassistant/components/deconz/light.py index 2da435c55308..f7ae45781acc 100644 --- a/homeassistant/components/deconz/light.py +++ b/homeassistant/components/deconz/light.py @@ -223,7 +223,7 @@ class DeconzBaseLight(DeconzDevice, LightEntity): await self._device.async_set_state(data) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return {"is_deconz_group": self._device.type == "LightGroup"} @@ -275,9 +275,9 @@ class DeconzGroup(DeconzBaseLight): } @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" - attributes = dict(super().device_state_attributes) + attributes = dict(super().extra_state_attributes) attributes["all_on"] = self._device.all_on return attributes diff --git a/homeassistant/components/deconz/sensor.py b/homeassistant/components/deconz/sensor.py index e3a7e6a001a0..b08ec0d091b2 100644 --- a/homeassistant/components/deconz/sensor.py +++ b/homeassistant/components/deconz/sensor.py @@ -155,7 +155,7 @@ class DeconzSensor(DeconzDevice): return UNIT_OF_MEASUREMENT.get(type(self._device)) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" attr = {} @@ -235,7 +235,7 @@ class DeconzBattery(DeconzDevice): return PERCENTAGE @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the battery.""" attr = {} diff --git a/homeassistant/components/delijn/sensor.py b/homeassistant/components/delijn/sensor.py index 0058816d3185..44b70c4e7a86 100644 --- a/homeassistant/components/delijn/sensor.py +++ b/homeassistant/components/delijn/sensor.py @@ -126,6 +126,6 @@ class DeLijnPublicTransportSensor(Entity): return "mdi:bus" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return attributes for the sensor.""" return self._attributes diff --git a/homeassistant/components/demo/remote.py b/homeassistant/components/demo/remote.py index 9d12621fef13..98e949f38c33 100644 --- a/homeassistant/components/demo/remote.py +++ b/homeassistant/components/demo/remote.py @@ -49,7 +49,7 @@ class DemoRemote(RemoteEntity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device state attributes.""" if self._last_command_sent is not None: return {"last_command_sent": self._last_command_sent} diff --git a/homeassistant/components/demo/sensor.py b/homeassistant/components/demo/sensor.py index 99aadf356d78..49930a353776 100644 --- a/homeassistant/components/demo/sensor.py +++ b/homeassistant/components/demo/sensor.py @@ -96,7 +96,7 @@ class DemoSensor(Entity): return self._unit_of_measurement @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self._battery: return {ATTR_BATTERY_LEVEL: self._battery} diff --git a/homeassistant/components/demo/vacuum.py b/homeassistant/components/demo/vacuum.py index ebb6b57ce14e..39413a1b9f7e 100644 --- a/homeassistant/components/demo/vacuum.py +++ b/homeassistant/components/demo/vacuum.py @@ -140,7 +140,7 @@ class DemoVacuum(VacuumEntity): return max(0, min(100, self._battery_level)) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device state attributes.""" return {ATTR_CLEANED_AREA: round(self._cleaned_area, 2)} @@ -288,7 +288,7 @@ class StateDemoVacuum(StateVacuumEntity): return FAN_SPEEDS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device state attributes.""" return {ATTR_CLEANED_AREA: round(self._cleaned_area, 2)} diff --git a/homeassistant/components/denonavr/media_player.py b/homeassistant/components/denonavr/media_player.py index 73fe0f2152d4..c1fbb15a2635 100644 --- a/homeassistant/components/denonavr/media_player.py +++ b/homeassistant/components/denonavr/media_player.py @@ -306,7 +306,7 @@ class DenonDevice(MediaPlayerEntity): return None @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific state attributes.""" if ( self._sound_mode_raw is not None diff --git a/homeassistant/components/derivative/sensor.py b/homeassistant/components/derivative/sensor.py index 7c2cc444a5a2..ddbe1d19e312 100644 --- a/homeassistant/components/derivative/sensor.py +++ b/homeassistant/components/derivative/sensor.py @@ -211,7 +211,7 @@ class DerivativeSensor(RestoreEntity): return False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return {ATTR_SOURCE_ID: self._sensor_source_id} diff --git a/homeassistant/components/deutsche_bahn/sensor.py b/homeassistant/components/deutsche_bahn/sensor.py index b3e4cd432ac0..1de6609c756c 100644 --- a/homeassistant/components/deutsche_bahn/sensor.py +++ b/homeassistant/components/deutsche_bahn/sensor.py @@ -65,7 +65,7 @@ class DeutscheBahnSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" connections = self.data.connections[0] if len(self.data.connections) > 1: diff --git a/homeassistant/components/device_tracker/legacy.py b/homeassistant/components/device_tracker/legacy.py index b7583d80f828..e947ae7b828c 100644 --- a/homeassistant/components/device_tracker/legacy.py +++ b/homeassistant/components/device_tracker/legacy.py @@ -675,7 +675,7 @@ class Device(RestoreEntity): return attributes @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device state attributes.""" return self._attributes diff --git a/homeassistant/components/digital_ocean/binary_sensor.py b/homeassistant/components/digital_ocean/binary_sensor.py index eb1345df45c0..9a9f82c36d2d 100644 --- a/homeassistant/components/digital_ocean/binary_sensor.py +++ b/homeassistant/components/digital_ocean/binary_sensor.py @@ -79,7 +79,7 @@ class DigitalOceanBinarySensor(BinarySensorEntity): return DEVICE_CLASS_MOVING @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the Digital Ocean droplet.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, diff --git a/homeassistant/components/digital_ocean/switch.py b/homeassistant/components/digital_ocean/switch.py index 811b844e35cd..0678b9ab1a15 100644 --- a/homeassistant/components/digital_ocean/switch.py +++ b/homeassistant/components/digital_ocean/switch.py @@ -71,7 +71,7 @@ class DigitalOceanSwitch(SwitchEntity): return self.data.status == "active" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the Digital Ocean droplet.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, diff --git a/homeassistant/components/directv/media_player.py b/homeassistant/components/directv/media_player.py index dfd88ca885b5..ee290ba5f2c4 100644 --- a/homeassistant/components/directv/media_player.py +++ b/homeassistant/components/directv/media_player.py @@ -124,7 +124,7 @@ class DIRECTVMediaPlayer(DIRECTVEntity, MediaPlayerEntity): self._assumed_state = self._is_recorded @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific state attributes.""" if self._is_standby: return {} diff --git a/homeassistant/components/discogs/sensor.py b/homeassistant/components/discogs/sensor.py index 4d78b540a0c7..6f45a4ab9598 100644 --- a/homeassistant/components/discogs/sensor.py +++ b/homeassistant/components/discogs/sensor.py @@ -121,7 +121,7 @@ class DiscogsSensor(Entity): return SENSORS[self._type]["unit_of_measurement"] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes of the sensor.""" if self._state is None or self._attrs is None: return None diff --git a/homeassistant/components/dlink/switch.py b/homeassistant/components/dlink/switch.py index c173c879ad18..432bc7ec0b36 100644 --- a/homeassistant/components/dlink/switch.py +++ b/homeassistant/components/dlink/switch.py @@ -71,7 +71,7 @@ class SmartPlugSwitch(SwitchEntity): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the device.""" try: ui_temp = self.units.temperature(int(self.data.temperature), TEMP_CELSIUS) diff --git a/homeassistant/components/doods/image_processing.py b/homeassistant/components/doods/image_processing.py index fb2b6daecdab..3e41c1871bfe 100644 --- a/homeassistant/components/doods/image_processing.py +++ b/homeassistant/components/doods/image_processing.py @@ -221,7 +221,7 @@ class Doods(ImageProcessingEntity): return self._total_matches @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific state attributes.""" return { ATTR_MATCHES: self._matches, diff --git a/homeassistant/components/dovado/sensor.py b/homeassistant/components/dovado/sensor.py index 46ff402788ec..8c8dffbb8b6e 100644 --- a/homeassistant/components/dovado/sensor.py +++ b/homeassistant/components/dovado/sensor.py @@ -105,6 +105,6 @@ class DovadoSensor(Entity): return SENSORS[self._sensor][2] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {k: v for k, v in self._data.state.items() if k not in ["date", "time"]} diff --git a/homeassistant/components/dublin_bus_transport/sensor.py b/homeassistant/components/dublin_bus_transport/sensor.py index 96e485a94e67..5b0cbaf9f189 100644 --- a/homeassistant/components/dublin_bus_transport/sensor.py +++ b/homeassistant/components/dublin_bus_transport/sensor.py @@ -87,7 +87,7 @@ class DublinPublicTransportSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self._times is not None: next_up = "None" diff --git a/homeassistant/components/dwd_weather_warnings/sensor.py b/homeassistant/components/dwd_weather_warnings/sensor.py index 79beebb005d1..af91e279600c 100644 --- a/homeassistant/components/dwd_weather_warnings/sensor.py +++ b/homeassistant/components/dwd_weather_warnings/sensor.py @@ -119,7 +119,7 @@ class DwdWeatherWarningsSensor(Entity): return self._api.api.expected_warning_level @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the DWD-Weather-Warnings.""" data = { ATTR_ATTRIBUTION: ATTRIBUTION, diff --git a/homeassistant/components/dyson/air_quality.py b/homeassistant/components/dyson/air_quality.py index 3bf4f2bb34c9..48b66fe76835 100644 --- a/homeassistant/components/dyson/air_quality.py +++ b/homeassistant/components/dyson/air_quality.py @@ -88,6 +88,6 @@ class DysonAirSensor(DysonEntity, AirQualityEntity): return int(self._device.environmental_state.volatile_organic_compounds) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return {ATTR_VOC: self.volatile_organic_compounds} diff --git a/homeassistant/components/dyson/fan.py b/homeassistant/components/dyson/fan.py index a8e737bb48b7..5b69092ac5d9 100644 --- a/homeassistant/components/dyson/fan.py +++ b/homeassistant/components/dyson/fan.py @@ -200,7 +200,7 @@ class DysonFanEntity(DysonEntity, FanEntity): return SUPPORT_OSCILLATE | SUPPORT_SET_SPEED @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Return optional state attributes.""" return { ATTR_NIGHT_MODE: self.night_mode, @@ -455,10 +455,10 @@ class DysonPureCoolEntity(DysonFanEntity): return int(self._device.state.carbon_filter_state) @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Return optional state attributes.""" return { - **super().device_state_attributes, + **super().extra_state_attributes, ATTR_ANGLE_LOW: self.angle_low, ATTR_ANGLE_HIGH: self.angle_high, ATTR_FLOW_DIRECTION_FRONT: self.flow_direction_front, diff --git a/homeassistant/components/dyson/vacuum.py b/homeassistant/components/dyson/vacuum.py index 466b409c342e..f4035d33cf3a 100644 --- a/homeassistant/components/dyson/vacuum.py +++ b/homeassistant/components/dyson/vacuum.py @@ -95,7 +95,7 @@ class Dyson360EyeDevice(DysonEntity, VacuumEntity): return ["Quiet", "Max"] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the specific state attributes of this vacuum cleaner.""" return {ATTR_POSITION: str(self._device.state.position)} diff --git a/homeassistant/components/eafm/sensor.py b/homeassistant/components/eafm/sensor.py index 746f6f34abcf..9e2d4e5cef9d 100644 --- a/homeassistant/components/eafm/sensor.py +++ b/homeassistant/components/eafm/sensor.py @@ -156,7 +156,7 @@ class Measurement(CoordinatorEntity): return UNIT_MAPPING.get(measure["unit"], measure["unitName"]) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the sensor specific state attributes.""" return {ATTR_ATTRIBUTION: self.attribution} diff --git a/homeassistant/components/ebusd/sensor.py b/homeassistant/components/ebusd/sensor.py index badb94a6f854..53dac4eb4c08 100644 --- a/homeassistant/components/ebusd/sensor.py +++ b/homeassistant/components/ebusd/sensor.py @@ -55,7 +55,7 @@ class EbusdSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" if self._type == 1 and self._state is not None: schedule = { diff --git a/homeassistant/components/ecobee/climate.py b/homeassistant/components/ecobee/climate.py index 089f09508547..c32244109930 100644 --- a/homeassistant/components/ecobee/climate.py +++ b/homeassistant/components/ecobee/climate.py @@ -519,7 +519,7 @@ class Thermostat(ClimateEntity): return CURRENT_HVAC_IDLE @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific state attributes.""" status = self.thermostat["equipmentStatus"] return { diff --git a/homeassistant/components/ecovacs/vacuum.py b/homeassistant/components/ecovacs/vacuum.py index 6ad51e6c4741..934833c0f952 100644 --- a/homeassistant/components/ecovacs/vacuum.py +++ b/homeassistant/components/ecovacs/vacuum.py @@ -189,7 +189,7 @@ class EcovacsVacuum(VacuumEntity): self.device.run(sucks.VacBotCommand(command, params)) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device-specific state attributes of this vacuum.""" data = {} data[ATTR_ERROR] = self._error diff --git a/homeassistant/components/edl21/sensor.py b/homeassistant/components/edl21/sensor.py index dc0f51abe61f..1f21eaa4004f 100644 --- a/homeassistant/components/edl21/sensor.py +++ b/homeassistant/components/edl21/sensor.py @@ -269,7 +269,7 @@ class EDL21Entity(Entity): return self._telegram.get("value") @property - def device_state_attributes(self): + def extra_state_attributes(self): """Enumerate supported attributes.""" return { self._state_attrs[k]: v diff --git a/homeassistant/components/eight_sleep/sensor.py b/homeassistant/components/eight_sleep/sensor.py index 43bcb4c2f093..f858309d02cb 100644 --- a/homeassistant/components/eight_sleep/sensor.py +++ b/homeassistant/components/eight_sleep/sensor.py @@ -110,7 +110,7 @@ class EightHeatSensor(EightSleepHeatEntity): self._state = self._usrobj.heating_level @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device state attributes.""" return { ATTR_TARGET_HEAT: self._usrobj.target_heating_level, @@ -202,7 +202,7 @@ class EightUserSensor(EightSleepUserEntity): self._state = self._usrobj.current_values["stage"] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device state attributes.""" if self._attr is None: # Skip attributes if sensor type doesn't support diff --git a/homeassistant/components/elkm1/__init__.py b/homeassistant/components/elkm1/__init__.py index 3dddd670bb4c..568b3109227c 100644 --- a/homeassistant/components/elkm1/__init__.py +++ b/homeassistant/components/elkm1/__init__.py @@ -429,7 +429,7 @@ class ElkEntity(Entity): return False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the default attributes of the element.""" return {**self._element.as_dict(), **self.initial_attrs()} diff --git a/homeassistant/components/elkm1/alarm_control_panel.py b/homeassistant/components/elkm1/alarm_control_panel.py index 8f752cd9adf3..756166c86a60 100644 --- a/homeassistant/components/elkm1/alarm_control_panel.py +++ b/homeassistant/components/elkm1/alarm_control_panel.py @@ -173,7 +173,7 @@ class ElkArea(ElkAttachedEntity, AlarmControlPanelEntity, RestoreEntity): return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT @property - def device_state_attributes(self): + def extra_state_attributes(self): """Attributes of the area.""" attrs = self.initial_attrs() elmt = self._element diff --git a/homeassistant/components/elkm1/sensor.py b/homeassistant/components/elkm1/sensor.py index c6442af2e44c..7d63f283f0b2 100644 --- a/homeassistant/components/elkm1/sensor.py +++ b/homeassistant/components/elkm1/sensor.py @@ -136,7 +136,7 @@ class ElkKeypad(ElkSensor): return "mdi:thermometer-lines" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Attributes of the sensor.""" attrs = self.initial_attrs() attrs["area"] = self._element.area + 1 @@ -163,7 +163,7 @@ class ElkPanel(ElkSensor): return "mdi:home" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Attributes of the sensor.""" attrs = self.initial_attrs() attrs["system_trouble_status"] = self._element.system_trouble_status @@ -190,7 +190,7 @@ class ElkSetting(ElkSensor): self._state = self._element.value @property - def device_state_attributes(self): + def extra_state_attributes(self): """Attributes of the sensor.""" attrs = self.initial_attrs() attrs["value_format"] = SettingFormat(self._element.value_format).name.lower() @@ -227,7 +227,7 @@ class ElkZone(ElkSensor): return f"mdi:{zone_icons.get(self._element.definition, 'alarm-bell')}" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Attributes of the sensor.""" attrs = self.initial_attrs() attrs["physical_status"] = ZonePhysicalStatus( diff --git a/homeassistant/components/elv/switch.py b/homeassistant/components/elv/switch.py index 12b21c23d1a7..48eb9675277b 100644 --- a/homeassistant/components/elv/switch.py +++ b/homeassistant/components/elv/switch.py @@ -74,7 +74,7 @@ class SmartPlugSwitch(SwitchEntity): self._pca.turn_off(self._device_id) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the device.""" return self._emeter_params diff --git a/homeassistant/components/emoncms/sensor.py b/homeassistant/components/emoncms/sensor.py index dca9c870022e..523350532a02 100644 --- a/homeassistant/components/emoncms/sensor.py +++ b/homeassistant/components/emoncms/sensor.py @@ -175,7 +175,7 @@ class EmonCmsSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the attributes of the sensor.""" return { ATTR_FEEDID: self._elem["id"], diff --git a/homeassistant/components/enigma2/media_player.py b/homeassistant/components/enigma2/media_player.py index 4baa6aaf047c..1c32b1ab8052 100644 --- a/homeassistant/components/enigma2/media_player.py +++ b/homeassistant/components/enigma2/media_player.py @@ -251,7 +251,7 @@ class Enigma2Device(MediaPlayerEntity): self.e2_box.update() @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific state attributes. isRecording: Is the box currently recording. diff --git a/homeassistant/components/enphase_envoy/sensor.py b/homeassistant/components/enphase_envoy/sensor.py index 64b4fdf66ad9..e40c8e94372f 100644 --- a/homeassistant/components/enphase_envoy/sensor.py +++ b/homeassistant/components/enphase_envoy/sensor.py @@ -202,7 +202,7 @@ class Envoy(CoordinatorEntity): return ICON @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if ( self._type == "inverters" diff --git a/homeassistant/components/entur_public_transport/sensor.py b/homeassistant/components/entur_public_transport/sensor.py index 883b5c43d7ec..23c895c58a17 100644 --- a/homeassistant/components/entur_public_transport/sensor.py +++ b/homeassistant/components/entur_public_transport/sensor.py @@ -172,7 +172,7 @@ class EnturPublicTransportSensor(Entity): return self._state @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Return the state attributes.""" self._attributes[ATTR_ATTRIBUTION] = ATTRIBUTION self._attributes[ATTR_STOP_ID] = self._stop diff --git a/homeassistant/components/environment_canada/camera.py b/homeassistant/components/environment_canada/camera.py index 7021d637cfd9..019dcb1aee5a 100644 --- a/homeassistant/components/environment_canada/camera.py +++ b/homeassistant/components/environment_canada/camera.py @@ -81,7 +81,7 @@ class ECCamera(Camera): return "Environment Canada Radar" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the device.""" return {ATTR_ATTRIBUTION: CONF_ATTRIBUTION, ATTR_UPDATED: self.timestamp} diff --git a/homeassistant/components/environment_canada/sensor.py b/homeassistant/components/environment_canada/sensor.py index 20eb6fac9eef..f178b3c6275f 100644 --- a/homeassistant/components/environment_canada/sensor.py +++ b/homeassistant/components/environment_canada/sensor.py @@ -95,7 +95,7 @@ class ECSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the device.""" return self._attr diff --git a/homeassistant/components/envisalink/binary_sensor.py b/homeassistant/components/envisalink/binary_sensor.py index 544456604845..22089ee79073 100644 --- a/homeassistant/components/envisalink/binary_sensor.py +++ b/homeassistant/components/envisalink/binary_sensor.py @@ -56,7 +56,7 @@ class EnvisalinkBinarySensor(EnvisalinkDevice, BinarySensorEntity): async_dispatcher_connect(self.hass, SIGNAL_ZONE_UPDATE, self._update_callback) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" attr = {} diff --git a/homeassistant/components/envisalink/sensor.py b/homeassistant/components/envisalink/sensor.py index 3f3711b2e40a..9551b51b3e91 100644 --- a/homeassistant/components/envisalink/sensor.py +++ b/homeassistant/components/envisalink/sensor.py @@ -66,7 +66,7 @@ class EnvisalinkSensor(EnvisalinkDevice, Entity): return self._info["status"]["alpha"] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._info["status"] diff --git a/homeassistant/components/epson/media_player.py b/homeassistant/components/epson/media_player.py index 24ed62067f91..6115cdd6ef49 100644 --- a/homeassistant/components/epson/media_player.py +++ b/homeassistant/components/epson/media_player.py @@ -215,7 +215,7 @@ class EpsonProjectorMediaPlayer(MediaPlayerEntity): await self._projector.send_command(BACK) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific state attributes.""" if self._cmode is None: return {} diff --git a/homeassistant/components/eq3btsmart/climate.py b/homeassistant/components/eq3btsmart/climate.py index 43c6bd9f35b3..f803c9c0bd5c 100644 --- a/homeassistant/components/eq3btsmart/climate.py +++ b/homeassistant/components/eq3btsmart/climate.py @@ -155,7 +155,7 @@ class EQ3BTSmartThermostat(ClimateEntity): return self._thermostat.max_temp @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device specific state attributes.""" dev_specific = { ATTR_STATE_AWAY_END: self._thermostat.away_end, diff --git a/homeassistant/components/etherscan/sensor.py b/homeassistant/components/etherscan/sensor.py index 1c14ce578c16..e56b49181d45 100644 --- a/homeassistant/components/etherscan/sensor.py +++ b/homeassistant/components/etherscan/sensor.py @@ -70,7 +70,7 @@ class EtherscanSensor(Entity): return self._unit_of_measurement @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return {ATTR_ATTRIBUTION: ATTRIBUTION} diff --git a/homeassistant/components/evohome/__init__.py b/homeassistant/components/evohome/__init__.py index 268e7709af38..006fbb1610d8 100644 --- a/homeassistant/components/evohome/__init__.py +++ b/homeassistant/components/evohome/__init__.py @@ -556,7 +556,7 @@ class EvoDevice(Entity): return self._name @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the evohome-specific state attributes.""" status = self._device_state_attrs if "systemModeStatus" in status: diff --git a/homeassistant/components/ezviz/camera.py b/homeassistant/components/ezviz/camera.py index b9b2463314b1..4cce0e686546 100644 --- a/homeassistant/components/ezviz/camera.py +++ b/homeassistant/components/ezviz/camera.py @@ -158,7 +158,7 @@ class HassEzvizCamera(Camera): return True @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the Ezviz-specific camera state attributes.""" return { # if privacy == true, the device closed the lid or did a 180° tilt diff --git a/tests/components/arlo/test_sensor.py b/tests/components/arlo/test_sensor.py index 5d729a5a6589..b8389d1903fb 100644 --- a/tests/components/arlo/test_sensor.py +++ b/tests/components/arlo/test_sensor.py @@ -194,7 +194,7 @@ def test_update_captured_today(captured_sensor): def _test_attributes(sensor_type): data = _get_named_tuple({"model_id": "TEST123"}) sensor = _get_sensor("test", sensor_type, data) - attrs = sensor.device_state_attributes + attrs = sensor.extra_state_attributes assert attrs.get(ATTR_ATTRIBUTION) == "Data provided by arlo.netgear.com" assert attrs.get("brand") == "Netgear Arlo" assert attrs.get("model") == "TEST123" @@ -211,7 +211,7 @@ def test_state_attributes(): def test_attributes_total_cameras(cameras_sensor): """Test attributes for total cameras sensor type.""" - attrs = cameras_sensor.device_state_attributes + attrs = cameras_sensor.extra_state_attributes assert attrs.get(ATTR_ATTRIBUTION) == "Data provided by arlo.netgear.com" assert attrs.get("brand") == "Netgear Arlo" assert attrs.get("model") is None diff --git a/tests/components/ecobee/test_climate.py b/tests/components/ecobee/test_climate.py index 975fabcf9ab3..92ad310f68d0 100644 --- a/tests/components/ecobee/test_climate.py +++ b/tests/components/ecobee/test_climate.py @@ -147,7 +147,7 @@ async def test_hvac_mode2(ecobee_fixture, thermostat): assert thermostat.hvac_mode == "heat" -async def test_device_state_attributes(ecobee_fixture, thermostat): +async def test_extra_state_attributes(ecobee_fixture, thermostat): """Test device state attributes property.""" ecobee_fixture["equipmentStatus"] = "heatPump2" assert { @@ -155,7 +155,7 @@ async def test_device_state_attributes(ecobee_fixture, thermostat): "climate_mode": "Climate1", "fan_min_on_time": 10, "equipment_running": "heatPump2", - } == thermostat.device_state_attributes + } == thermostat.extra_state_attributes ecobee_fixture["equipmentStatus"] = "auxHeat2" assert { @@ -163,21 +163,21 @@ async def test_device_state_attributes(ecobee_fixture, thermostat): "climate_mode": "Climate1", "fan_min_on_time": 10, "equipment_running": "auxHeat2", - } == thermostat.device_state_attributes + } == thermostat.extra_state_attributes ecobee_fixture["equipmentStatus"] = "compCool1" assert { "fan": "off", "climate_mode": "Climate1", "fan_min_on_time": 10, "equipment_running": "compCool1", - } == thermostat.device_state_attributes + } == thermostat.extra_state_attributes ecobee_fixture["equipmentStatus"] = "" assert { "fan": "off", "climate_mode": "Climate1", "fan_min_on_time": 10, "equipment_running": "", - } == thermostat.device_state_attributes + } == thermostat.extra_state_attributes ecobee_fixture["equipmentStatus"] = "Unknown" assert { @@ -185,7 +185,7 @@ async def test_device_state_attributes(ecobee_fixture, thermostat): "climate_mode": "Climate1", "fan_min_on_time": 10, "equipment_running": "Unknown", - } == thermostat.device_state_attributes + } == thermostat.extra_state_attributes ecobee_fixture["program"]["currentClimateRef"] = "c2" assert { @@ -193,7 +193,7 @@ async def test_device_state_attributes(ecobee_fixture, thermostat): "climate_mode": "Climate2", "fan_min_on_time": 10, "equipment_running": "Unknown", - } == thermostat.device_state_attributes + } == thermostat.extra_state_attributes async def test_is_aux_heat_on(ecobee_fixture, thermostat):