From af4d06b12e7237de90b62b5aaa31025acee05a2e Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 11 Mar 2021 16:57:47 +0100 Subject: [PATCH] Update integrations f-i to override extra_state_attributes() (#47757) --- .../components/faa_delays/binary_sensor.py | 2 +- .../components/facebox/image_processing.py | 2 +- homeassistant/components/fibaro/__init__.py | 2 +- homeassistant/components/fido/sensor.py | 2 +- homeassistant/components/filesize/sensor.py | 2 +- homeassistant/components/filter/sensor.py | 2 +- homeassistant/components/fints/sensor.py | 4 ++-- .../fireservicerota/binary_sensor.py | 2 +- .../components/fireservicerota/sensor.py | 2 +- .../components/fireservicerota/switch.py | 2 +- homeassistant/components/fitbit/sensor.py | 2 +- homeassistant/components/fixer/sensor.py | 2 +- homeassistant/components/flexit/climate.py | 2 +- .../components/flic/binary_sensor.py | 2 +- .../components/flick_electric/sensor.py | 2 +- homeassistant/components/flo/binary_sensor.py | 2 +- homeassistant/components/flunearyou/sensor.py | 2 +- homeassistant/components/folder/sensor.py | 2 +- .../components/freebox/device_tracker.py | 2 +- homeassistant/components/freebox/sensor.py | 2 +- homeassistant/components/fritzbox/climate.py | 2 +- homeassistant/components/fritzbox/sensor.py | 2 +- homeassistant/components/fritzbox/switch.py | 2 +- .../components/fritzbox_callmonitor/sensor.py | 2 +- homeassistant/components/garadget/cover.py | 2 +- .../components/garmin_connect/sensor.py | 2 +- .../components/gdacs/geo_location.py | 2 +- homeassistant/components/gdacs/sensor.py | 2 +- homeassistant/components/geizhals/sensor.py | 2 +- .../components/geniushub/__init__.py | 4 ++-- homeassistant/components/geniushub/sensor.py | 2 +- .../geo_json_events/geo_location.py | 2 +- .../components/geo_rss_events/sensor.py | 2 +- .../components/geofency/device_tracker.py | 2 +- .../geonetnz_quakes/geo_location.py | 2 +- .../components/geonetnz_quakes/sensor.py | 2 +- .../components/geonetnz_volcano/sensor.py | 2 +- homeassistant/components/gios/air_quality.py | 2 +- homeassistant/components/github/sensor.py | 2 +- homeassistant/components/gitlab_ci/sensor.py | 2 +- homeassistant/components/gitter/sensor.py | 2 +- homeassistant/components/gogogate2/cover.py | 2 +- homeassistant/components/gogogate2/sensor.py | 2 +- homeassistant/components/google/calendar.py | 2 +- .../components/google_travel_time/sensor.py | 2 +- homeassistant/components/gpsd/sensor.py | 2 +- .../components/gpslogger/device_tracker.py | 2 +- .../components/greeneye_monitor/sensor.py | 4 ++-- homeassistant/components/group/cover.py | 2 +- homeassistant/components/group/light.py | 2 +- homeassistant/components/gtfs/sensor.py | 2 +- homeassistant/components/guardian/__init__.py | 2 +- homeassistant/components/habitica/sensor.py | 2 +- homeassistant/components/harmony/remote.py | 2 +- .../components/haveibeenpwned/sensor.py | 2 +- homeassistant/components/hddtemp/sensor.py | 2 +- homeassistant/components/hdmi_cec/__init__.py | 2 +- homeassistant/components/heos/media_player.py | 2 +- .../components/here_travel_time/sensor.py | 2 +- .../components/hikvision/binary_sensor.py | 2 +- .../components/history_stats/sensor.py | 2 +- .../components/hive/binary_sensor.py | 2 +- homeassistant/components/hive/climate.py | 2 +- homeassistant/components/hive/light.py | 2 +- homeassistant/components/hive/sensor.py | 2 +- homeassistant/components/hive/switch.py | 2 +- .../components/homeassistant/scene.py | 2 +- .../homekit_controller/air_quality.py | 2 +- .../homekit_controller/alarm_control_panel.py | 2 +- .../components/homekit_controller/cover.py | 4 ++-- .../components/homekit_controller/lock.py | 2 +- .../components/homekit_controller/switch.py | 4 ++-- .../homematicip_cloud/binary_sensor.py | 20 +++++++++---------- .../components/homematicip_cloud/climate.py | 4 ++-- .../homematicip_cloud/generic_entity.py | 2 +- .../components/homematicip_cloud/light.py | 8 ++++---- .../components/homematicip_cloud/sensor.py | 16 +++++++-------- .../components/homematicip_cloud/switch.py | 4 ++-- homeassistant/components/homeworks/light.py | 2 +- homeassistant/components/honeywell/climate.py | 2 +- homeassistant/components/hp_ilo/sensor.py | 2 +- .../components/huawei_lte/binary_sensor.py | 2 +- .../components/huawei_lte/device_tracker.py | 10 +++++----- homeassistant/components/hue/binary_sensor.py | 4 ++-- homeassistant/components/hue/light.py | 2 +- homeassistant/components/hue/sensor.py | 4 ++-- homeassistant/components/hue/sensor_base.py | 2 +- .../hunterdouglas_powerview/cover.py | 2 +- .../hunterdouglas_powerview/scene.py | 2 +- .../hvv_departures/binary_sensor.py | 2 +- .../components/hvv_departures/sensor.py | 2 +- .../components/hydrawise/__init__.py | 2 +- .../components/icloud/device_tracker.py | 2 +- homeassistant/components/icloud/sensor.py | 2 +- .../components/ign_sismologia/geo_location.py | 2 +- homeassistant/components/ihc/ihcdevice.py | 2 +- .../components/imap_email_content/sensor.py | 2 +- .../components/incomfort/binary_sensor.py | 2 +- homeassistant/components/incomfort/climate.py | 2 +- homeassistant/components/incomfort/sensor.py | 2 +- .../components/incomfort/water_heater.py | 2 +- homeassistant/components/insteon/climate.py | 4 ++-- .../components/insteon/insteon_entity.py | 2 +- .../components/integration/sensor.py | 2 +- .../components/intesishome/climate.py | 2 +- homeassistant/components/ios/sensor.py | 2 +- homeassistant/components/iota/__init__.py | 2 +- homeassistant/components/iota/sensor.py | 2 +- homeassistant/components/iperf3/sensor.py | 2 +- homeassistant/components/ipp/sensor.py | 4 ++-- homeassistant/components/iqvia/__init__.py | 2 +- .../components/irish_rail_transport/sensor.py | 2 +- homeassistant/components/iss/binary_sensor.py | 2 +- .../components/isy994/binary_sensor.py | 4 ++-- homeassistant/components/isy994/light.py | 4 ++-- homeassistant/components/isy994/sensor.py | 2 +- homeassistant/components/izone/climate.py | 4 ++-- tests/components/honeywell/test_climate.py | 6 +++--- .../imap_email_content/test_sensor.py | 16 +++++++-------- 119 files changed, 165 insertions(+), 165 deletions(-) diff --git a/homeassistant/components/faa_delays/binary_sensor.py b/homeassistant/components/faa_delays/binary_sensor.py index 6c5876b7017..b96ee24a5bc 100644 --- a/homeassistant/components/faa_delays/binary_sensor.py +++ b/homeassistant/components/faa_delays/binary_sensor.py @@ -68,7 +68,7 @@ class FAABinarySensor(CoordinatorEntity, BinarySensorEntity): return f"{self._id}_{self._sensor_type}" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return attributes for sensor.""" if self._sensor_type == "GROUND_DELAY": self._attrs["average"] = self.coordinator.data.ground_delay.average diff --git a/homeassistant/components/facebox/image_processing.py b/homeassistant/components/facebox/image_processing.py index 6a460ac305b..5c90ce73560 100644 --- a/homeassistant/components/facebox/image_processing.py +++ b/homeassistant/components/facebox/image_processing.py @@ -263,7 +263,7 @@ class FaceClassifyEntity(ImageProcessingFaceEntity): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the classifier attributes.""" return { "matched_faces": self._matched, diff --git a/homeassistant/components/fibaro/__init__.py b/homeassistant/components/fibaro/__init__.py index d2a81468e05..9ce284d51ab 100644 --- a/homeassistant/components/fibaro/__init__.py +++ b/homeassistant/components/fibaro/__init__.py @@ -506,7 +506,7 @@ class FibaroDevice(Entity): return False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the device.""" attr = {"fibaro_id": self.fibaro_device.id} diff --git a/homeassistant/components/fido/sensor.py b/homeassistant/components/fido/sensor.py index 22522d1ab74..fe9c60c85a6 100644 --- a/homeassistant/components/fido/sensor.py +++ b/homeassistant/components/fido/sensor.py @@ -125,7 +125,7 @@ class FidoSensor(Entity): return self._icon @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return {"number": self._number} diff --git a/homeassistant/components/filesize/sensor.py b/homeassistant/components/filesize/sensor.py index 27122a3cb9c..312805e4942 100644 --- a/homeassistant/components/filesize/sensor.py +++ b/homeassistant/components/filesize/sensor.py @@ -76,7 +76,7 @@ class Filesize(Entity): return ICON @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return other details about the sensor state.""" return { "path": self._path, diff --git a/homeassistant/components/filter/sensor.py b/homeassistant/components/filter/sensor.py index d46709924ea..f4be797d12b 100644 --- a/homeassistant/components/filter/sensor.py +++ b/homeassistant/components/filter/sensor.py @@ -351,7 +351,7 @@ class SensorFilter(Entity): return False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return {ATTR_ENTITY_ID: self._entity} diff --git a/homeassistant/components/fints/sensor.py b/homeassistant/components/fints/sensor.py index 6cd62333a87..4ccd2b6f848 100644 --- a/homeassistant/components/fints/sensor.py +++ b/homeassistant/components/fints/sensor.py @@ -193,7 +193,7 @@ class FinTsAccount(Entity): return self._currency @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Additional attributes of the sensor.""" attributes = {ATTR_ACCOUNT: self._account.iban, ATTR_ACCOUNT_TYPE: "balance"} if self._client.name: @@ -238,7 +238,7 @@ class FinTsHoldingsAccount(Entity): return ICON @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Additional attributes of the sensor. Lists each holding of the account with the current value. diff --git a/homeassistant/components/fireservicerota/binary_sensor.py b/homeassistant/components/fireservicerota/binary_sensor.py index 3f04adc2f72..29fc97ae503 100644 --- a/homeassistant/components/fireservicerota/binary_sensor.py +++ b/homeassistant/components/fireservicerota/binary_sensor.py @@ -62,7 +62,7 @@ class ResponseBinarySensor(CoordinatorEntity, BinarySensorEntity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return available attributes for binary sensor.""" attr = {} if not self.coordinator.data: diff --git a/homeassistant/components/fireservicerota/sensor.py b/homeassistant/components/fireservicerota/sensor.py index 83272eff926..7dc8f546c98 100644 --- a/homeassistant/components/fireservicerota/sensor.py +++ b/homeassistant/components/fireservicerota/sensor.py @@ -64,7 +64,7 @@ class IncidentsSensor(RestoreEntity): return False @property - def device_state_attributes(self) -> object: + def extra_state_attributes(self) -> object: """Return available attributes for sensor.""" attr = {} data = self._state_attributes diff --git a/homeassistant/components/fireservicerota/switch.py b/homeassistant/components/fireservicerota/switch.py index 7519270ca5c..e2385f02e5c 100644 --- a/homeassistant/components/fireservicerota/switch.py +++ b/homeassistant/components/fireservicerota/switch.py @@ -73,7 +73,7 @@ class ResponseSwitch(SwitchEntity): return self._client.on_duty @property - def device_state_attributes(self) -> object: + def extra_state_attributes(self) -> object: """Return available attributes for switch.""" attr = {} if not self._state_attributes: diff --git a/homeassistant/components/fitbit/sensor.py b/homeassistant/components/fitbit/sensor.py index 387eb78448c..b90d33adaff 100644 --- a/homeassistant/components/fitbit/sensor.py +++ b/homeassistant/components/fitbit/sensor.py @@ -457,7 +457,7 @@ class FitbitSensor(Entity): return f"mdi:{FITBIT_RESOURCES_LIST[self.resource_type][2]}" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" attrs = {} diff --git a/homeassistant/components/fixer/sensor.py b/homeassistant/components/fixer/sensor.py index 99ebbdd6bb6..9641f596e61 100644 --- a/homeassistant/components/fixer/sensor.py +++ b/homeassistant/components/fixer/sensor.py @@ -75,7 +75,7 @@ class ExchangeRateSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self.data.rate is not None: return { diff --git a/homeassistant/components/flexit/climate.py b/homeassistant/components/flexit/climate.py index 450d09edeb8..ef399796898 100644 --- a/homeassistant/components/flexit/climate.py +++ b/homeassistant/components/flexit/climate.py @@ -93,7 +93,7 @@ class Flexit(ClimateEntity): self._current_operation = self.unit.get_operation @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific state attributes.""" return { "filter_hours": self._filter_hours, diff --git a/homeassistant/components/flic/binary_sensor.py b/homeassistant/components/flic/binary_sensor.py index e81f8f2f5b0..6ddaddced0d 100644 --- a/homeassistant/components/flic/binary_sensor.py +++ b/homeassistant/components/flic/binary_sensor.py @@ -186,7 +186,7 @@ class FlicButton(BinarySensorEntity): return False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific state attributes.""" return {"address": self.address} diff --git a/homeassistant/components/flick_electric/sensor.py b/homeassistant/components/flick_electric/sensor.py index 9d441ce7574..4f152c54e3c 100644 --- a/homeassistant/components/flick_electric/sensor.py +++ b/homeassistant/components/flick_electric/sensor.py @@ -61,7 +61,7 @@ class FlickPricingSensor(Entity): return UNIT_NAME @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._attributes diff --git a/homeassistant/components/flo/binary_sensor.py b/homeassistant/components/flo/binary_sensor.py index 3ab1152f83e..96909b3bd9c 100644 --- a/homeassistant/components/flo/binary_sensor.py +++ b/homeassistant/components/flo/binary_sensor.py @@ -48,7 +48,7 @@ class FloPendingAlertsBinarySensor(FloEntity, BinarySensorEntity): return self._device.has_alerts @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if not self._device.has_alerts: return {} diff --git a/homeassistant/components/flunearyou/sensor.py b/homeassistant/components/flunearyou/sensor.py index 8bb5f1317d1..225ed15d98b 100644 --- a/homeassistant/components/flunearyou/sensor.py +++ b/homeassistant/components/flunearyou/sensor.py @@ -100,7 +100,7 @@ class FluNearYouSensor(CoordinatorEntity): self._unit = unit @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return self._attrs diff --git a/homeassistant/components/folder/sensor.py b/homeassistant/components/folder/sensor.py index 9a062133718..cfbfd670d05 100644 --- a/homeassistant/components/folder/sensor.py +++ b/homeassistant/components/folder/sensor.py @@ -92,7 +92,7 @@ class Folder(Entity): return self.ICON @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return other details about the sensor state.""" return { "path": self._folder_path, diff --git a/homeassistant/components/freebox/device_tracker.py b/homeassistant/components/freebox/device_tracker.py index 10c5b8eb2c5..8b1b214c33a 100644 --- a/homeassistant/components/freebox/device_tracker.py +++ b/homeassistant/components/freebox/device_tracker.py @@ -105,7 +105,7 @@ class FreeboxDevice(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/freebox/sensor.py b/homeassistant/components/freebox/sensor.py index b8881ad7949..d014d85f6dc 100644 --- a/homeassistant/components/freebox/sensor.py +++ b/homeassistant/components/freebox/sensor.py @@ -180,7 +180,7 @@ class FreeboxCallSensor(FreeboxSensor): self._state = len(self._call_list_for_type) @property - def device_state_attributes(self) -> Dict[str, any]: + def extra_state_attributes(self) -> Dict[str, any]: """Return device specific state attributes.""" return { dt_util.utc_from_timestamp(call["datetime"]).isoformat(): call["name"] diff --git a/homeassistant/components/fritzbox/climate.py b/homeassistant/components/fritzbox/climate.py index 4abe82776a9..50f56f3d510 100644 --- a/homeassistant/components/fritzbox/climate.py +++ b/homeassistant/components/fritzbox/climate.py @@ -191,7 +191,7 @@ class FritzboxThermostat(ClimateEntity): return MAX_TEMPERATURE @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device specific state attributes.""" attrs = { ATTR_STATE_BATTERY_LOW: self._device.battery_low, diff --git a/homeassistant/components/fritzbox/sensor.py b/homeassistant/components/fritzbox/sensor.py index 85238d80f27..470d110429c 100644 --- a/homeassistant/components/fritzbox/sensor.py +++ b/homeassistant/components/fritzbox/sensor.py @@ -80,7 +80,7 @@ class FritzBoxTempSensor(Entity): self._fritz.login() @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the device.""" attrs = { ATTR_STATE_DEVICE_LOCKED: self._device.device_lock, diff --git a/homeassistant/components/fritzbox/switch.py b/homeassistant/components/fritzbox/switch.py index b179464182f..50c60f7bb39 100644 --- a/homeassistant/components/fritzbox/switch.py +++ b/homeassistant/components/fritzbox/switch.py @@ -93,7 +93,7 @@ class FritzboxSwitch(SwitchEntity): self._fritz.login() @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the device.""" attrs = {} attrs[ATTR_STATE_DEVICE_LOCKED] = self._device.device_lock diff --git a/homeassistant/components/fritzbox_callmonitor/sensor.py b/homeassistant/components/fritzbox_callmonitor/sensor.py index 891bf8131d6..82ce075268b 100644 --- a/homeassistant/components/fritzbox_callmonitor/sensor.py +++ b/homeassistant/components/fritzbox_callmonitor/sensor.py @@ -169,7 +169,7 @@ class FritzBoxCallSensor(Entity): return ICON_PHONE @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self._prefixes: self._attributes[ATTR_PREFIXES] = self._prefixes diff --git a/homeassistant/components/garadget/cover.py b/homeassistant/components/garadget/cover.py index 9c089e85811..206aaa6614d 100644 --- a/homeassistant/components/garadget/cover.py +++ b/homeassistant/components/garadget/cover.py @@ -135,7 +135,7 @@ class GaradgetCover(CoverEntity): return self._available @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" data = {} diff --git a/homeassistant/components/garmin_connect/sensor.py b/homeassistant/components/garmin_connect/sensor.py index 5d18f0a0dd0..d2a6419cc75 100644 --- a/homeassistant/components/garmin_connect/sensor.py +++ b/homeassistant/components/garmin_connect/sensor.py @@ -120,7 +120,7 @@ class GarminConnectSensor(Entity): return self._unit @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return attributes for sensor.""" if not self._data.data: return {} diff --git a/homeassistant/components/gdacs/geo_location.py b/homeassistant/components/gdacs/geo_location.py index 890c9f8e050..a2178bb78e0 100644 --- a/homeassistant/components/gdacs/geo_location.py +++ b/homeassistant/components/gdacs/geo_location.py @@ -213,7 +213,7 @@ class GdacsEvent(GeolocationEvent): return LENGTH_KILOMETERS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" attributes = {} for key, value in ( diff --git a/homeassistant/components/gdacs/sensor.py b/homeassistant/components/gdacs/sensor.py index fbbb199499b..c3642181427 100644 --- a/homeassistant/components/gdacs/sensor.py +++ b/homeassistant/components/gdacs/sensor.py @@ -129,7 +129,7 @@ class GdacsSensor(Entity): return DEFAULT_UNIT_OF_MEASUREMENT @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" attributes = {} for key, value in ( diff --git a/homeassistant/components/geizhals/sensor.py b/homeassistant/components/geizhals/sensor.py index 43e41e25e5e..5f11ae7d0ca 100644 --- a/homeassistant/components/geizhals/sensor.py +++ b/homeassistant/components/geizhals/sensor.py @@ -72,7 +72,7 @@ class Geizwatch(Entity): return self._device.prices[0] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" while len(self._device.prices) < 4: self._device.prices.append("None") diff --git a/homeassistant/components/geniushub/__init__.py b/homeassistant/components/geniushub/__init__.py index def964157e4..15a2c8e7686 100644 --- a/homeassistant/components/geniushub/__init__.py +++ b/homeassistant/components/geniushub/__init__.py @@ -250,7 +250,7 @@ class GeniusDevice(GeniusEntity): self._last_comms = self._state_attr = None @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the device state attributes.""" attrs = {} attrs["assigned_zone"] = self._device.data["assignedZones"][0]["name"] @@ -317,7 +317,7 @@ class GeniusZone(GeniusEntity): return self._zone.name @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the device state attributes.""" status = {k: v for k, v in self._zone.data.items() if k in GH_ZONE_ATTRS} return {"status": status} diff --git a/homeassistant/components/geniushub/sensor.py b/homeassistant/components/geniushub/sensor.py index 7e4fe81fc77..9d87fb46cb0 100644 --- a/homeassistant/components/geniushub/sensor.py +++ b/homeassistant/components/geniushub/sensor.py @@ -106,7 +106,7 @@ class GeniusIssue(GeniusEntity): return len(self._issues) @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the device state attributes.""" return {f"{self._level}_list": self._issues} diff --git a/homeassistant/components/geo_json_events/geo_location.py b/homeassistant/components/geo_json_events/geo_location.py index 40386648138..feb0b98b3fa 100644 --- a/homeassistant/components/geo_json_events/geo_location.py +++ b/homeassistant/components/geo_json_events/geo_location.py @@ -201,7 +201,7 @@ class GeoJsonLocationEvent(GeolocationEvent): return LENGTH_KILOMETERS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" if not self._external_id: return {} diff --git a/homeassistant/components/geo_rss_events/sensor.py b/homeassistant/components/geo_rss_events/sensor.py index c75234f5f2b..00ff63982fd 100644 --- a/homeassistant/components/geo_rss_events/sensor.py +++ b/homeassistant/components/geo_rss_events/sensor.py @@ -137,7 +137,7 @@ class GeoRssServiceSensor(Entity): return DEFAULT_ICON @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self._state_attributes diff --git a/homeassistant/components/geofency/device_tracker.py b/homeassistant/components/geofency/device_tracker.py index f090f516fb1..5a58e73d44a 100644 --- a/homeassistant/components/geofency/device_tracker.py +++ b/homeassistant/components/geofency/device_tracker.py @@ -56,7 +56,7 @@ class GeofencyEntity(TrackerEntity, RestoreEntity): self._unique_id = device @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific attributes.""" return self._attributes diff --git a/homeassistant/components/geonetnz_quakes/geo_location.py b/homeassistant/components/geonetnz_quakes/geo_location.py index 718b4c06b9c..62086f059f4 100644 --- a/homeassistant/components/geonetnz_quakes/geo_location.py +++ b/homeassistant/components/geonetnz_quakes/geo_location.py @@ -184,7 +184,7 @@ class GeonetnzQuakesEvent(GeolocationEvent): return LENGTH_KILOMETERS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" attributes = {} for key, value in ( diff --git a/homeassistant/components/geonetnz_quakes/sensor.py b/homeassistant/components/geonetnz_quakes/sensor.py index 1cb2d0dc091..e5476757024 100644 --- a/homeassistant/components/geonetnz_quakes/sensor.py +++ b/homeassistant/components/geonetnz_quakes/sensor.py @@ -130,7 +130,7 @@ class GeonetnzQuakesSensor(Entity): return DEFAULT_UNIT_OF_MEASUREMENT @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" attributes = {} for key, value in ( diff --git a/homeassistant/components/geonetnz_volcano/sensor.py b/homeassistant/components/geonetnz_volcano/sensor.py index 3d5d0681f02..7044b3c5609 100644 --- a/homeassistant/components/geonetnz_volcano/sensor.py +++ b/homeassistant/components/geonetnz_volcano/sensor.py @@ -149,7 +149,7 @@ class GeonetnzVolcanoSensor(Entity): return "alert level" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" attributes = {} for key, value in ( diff --git a/homeassistant/components/gios/air_quality.py b/homeassistant/components/gios/air_quality.py index 2853570ce58..ab83191a1ac 100644 --- a/homeassistant/components/gios/air_quality.py +++ b/homeassistant/components/gios/air_quality.py @@ -131,7 +131,7 @@ class GiosAirQuality(CoordinatorEntity, AirQualityEntity): } @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" # Different measuring stations have different sets of sensors. We don't know # what data we will get. diff --git a/homeassistant/components/github/sensor.py b/homeassistant/components/github/sensor.py index 80d05ae1b9c..f5f40c270a8 100644 --- a/homeassistant/components/github/sensor.py +++ b/homeassistant/components/github/sensor.py @@ -119,7 +119,7 @@ class GitHubSensor(Entity): return self._available @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" attrs = { ATTR_PATH: self._repository_path, diff --git a/homeassistant/components/gitlab_ci/sensor.py b/homeassistant/components/gitlab_ci/sensor.py index 9edbe9733a8..5eaa62e601d 100644 --- a/homeassistant/components/gitlab_ci/sensor.py +++ b/homeassistant/components/gitlab_ci/sensor.py @@ -99,7 +99,7 @@ class GitLabSensor(Entity): return self._available @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, diff --git a/homeassistant/components/gitter/sensor.py b/homeassistant/components/gitter/sensor.py index aff6dc17923..3f7888d8593 100644 --- a/homeassistant/components/gitter/sensor.py +++ b/homeassistant/components/gitter/sensor.py @@ -76,7 +76,7 @@ class GitterSensor(Entity): return self._unit_of_measurement @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return { ATTR_USERNAME: self._username, diff --git a/homeassistant/components/gogogate2/cover.py b/homeassistant/components/gogogate2/cover.py index 37c362893c8..053c35c171a 100644 --- a/homeassistant/components/gogogate2/cover.py +++ b/homeassistant/components/gogogate2/cover.py @@ -122,6 +122,6 @@ class DeviceCover(GoGoGate2Entity, CoverEntity): await self._api.async_close_door(self._get_door().door_id) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {"door_id": self._get_door().door_id} diff --git a/homeassistant/components/gogogate2/sensor.py b/homeassistant/components/gogogate2/sensor.py index c4f6cff9dfa..ed53779a95a 100644 --- a/homeassistant/components/gogogate2/sensor.py +++ b/homeassistant/components/gogogate2/sensor.py @@ -50,7 +50,7 @@ class DoorSensor(GoGoGate2Entity): return door.voltage # This is a percentage, not an absolute voltage @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/google/calendar.py b/homeassistant/components/google/calendar.py index 9040d37935d..2cc66121948 100644 --- a/homeassistant/components/google/calendar.py +++ b/homeassistant/components/google/calendar.py @@ -80,7 +80,7 @@ class GoogleCalendarEventDevice(CalendarEventDevice): self.entity_id = entity_id @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/google_travel_time/sensor.py b/homeassistant/components/google_travel_time/sensor.py index 098c6d2d59c..109b65a4225 100644 --- a/homeassistant/components/google_travel_time/sensor.py +++ b/homeassistant/components/google_travel_time/sensor.py @@ -230,7 +230,7 @@ class GoogleTravelTimeSensor(Entity): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self._matrix is None: return None diff --git a/homeassistant/components/gpsd/sensor.py b/homeassistant/components/gpsd/sensor.py index ea238269e59..978589e9a74 100644 --- a/homeassistant/components/gpsd/sensor.py +++ b/homeassistant/components/gpsd/sensor.py @@ -94,7 +94,7 @@ class GpsdSensor(Entity): return None @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the GPS.""" return { ATTR_LATITUDE: self.agps_thread.data_stream.lat, diff --git a/homeassistant/components/gpslogger/device_tracker.py b/homeassistant/components/gpslogger/device_tracker.py index 6999f26d752..25701e8c2e7 100644 --- a/homeassistant/components/gpslogger/device_tracker.py +++ b/homeassistant/components/gpslogger/device_tracker.py @@ -79,7 +79,7 @@ class GPSLoggerEntity(TrackerEntity, RestoreEntity): return self._battery @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return device specific attributes.""" return self._attributes diff --git a/homeassistant/components/greeneye_monitor/sensor.py b/homeassistant/components/greeneye_monitor/sensor.py index f026bdfe3a4..84352328312 100644 --- a/homeassistant/components/greeneye_monitor/sensor.py +++ b/homeassistant/components/greeneye_monitor/sensor.py @@ -175,7 +175,7 @@ class CurrentSensor(GEMSensor): return self._sensor.watts @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return total wattseconds in the state dictionary.""" if not self._sensor: return None @@ -242,7 +242,7 @@ class PulseCounter(GEMSensor): return f"{self._counted_quantity}/{self._time_unit}" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return total pulses in the data dictionary.""" if not self._sensor: return None diff --git a/homeassistant/components/group/cover.py b/homeassistant/components/group/cover.py index b52546c48d7..da842ee9f00 100644 --- a/homeassistant/components/group/cover.py +++ b/homeassistant/components/group/cover.py @@ -208,7 +208,7 @@ class CoverGroup(GroupEntity, CoverEntity): return self._tilt_position @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes for the cover group.""" return {ATTR_ENTITY_ID: self._entities} diff --git a/homeassistant/components/group/light.py b/homeassistant/components/group/light.py index 5720948bc01..482bdbafdab 100644 --- a/homeassistant/components/group/light.py +++ b/homeassistant/components/group/light.py @@ -187,7 +187,7 @@ class LightGroup(GroupEntity, light.LightEntity): return False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes for the light group.""" return {ATTR_ENTITY_ID: self._entity_ids} diff --git a/homeassistant/components/gtfs/sensor.py b/homeassistant/components/gtfs/sensor.py index d21ab67f053..23f9e2a8021 100644 --- a/homeassistant/components/gtfs/sensor.py +++ b/homeassistant/components/gtfs/sensor.py @@ -569,7 +569,7 @@ class GTFSDepartureSensor(Entity): return self._available @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Return the state attributes.""" return self._attributes diff --git a/homeassistant/components/guardian/__init__.py b/homeassistant/components/guardian/__init__.py index 465e1d730af..98f35d34e14 100644 --- a/homeassistant/components/guardian/__init__.py +++ b/homeassistant/components/guardian/__init__.py @@ -246,7 +246,7 @@ class GuardianEntity(CoordinatorEntity): return self._device_info @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Return the state attributes.""" return self._attrs diff --git a/homeassistant/components/habitica/sensor.py b/homeassistant/components/habitica/sensor.py index 29e494d89ee..4d61a86de75 100644 --- a/homeassistant/components/habitica/sensor.py +++ b/homeassistant/components/habitica/sensor.py @@ -200,7 +200,7 @@ class HabitipyTaskSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of all user tasks.""" if self._updater.tasks is not None: all_received_tasks = self._updater.tasks diff --git a/homeassistant/components/harmony/remote.py b/homeassistant/components/harmony/remote.py index 55af62e6d39..a09f32ee95e 100644 --- a/homeassistant/components/harmony/remote.py +++ b/homeassistant/components/harmony/remote.py @@ -193,7 +193,7 @@ class HarmonyRemote(ConnectionStateMixin, remote.RemoteEntity, RestoreEntity): return self._data.activity_names @property - def device_state_attributes(self): + def extra_state_attributes(self): """Add platform specific attributes.""" return { ATTR_ACTIVITY_STARTING: self._activity_starting, diff --git a/homeassistant/components/haveibeenpwned/sensor.py b/homeassistant/components/haveibeenpwned/sensor.py index 0f5a9b5ebfd..5aa336905e9 100644 --- a/homeassistant/components/haveibeenpwned/sensor.py +++ b/homeassistant/components/haveibeenpwned/sensor.py @@ -80,7 +80,7 @@ class HaveIBeenPwnedSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the attributes of the sensor.""" val = {ATTR_ATTRIBUTION: ATTRIBUTION} if self._email not in self._data.data: diff --git a/homeassistant/components/hddtemp/sensor.py b/homeassistant/components/hddtemp/sensor.py index a1052b0440a..e5f6621defe 100644 --- a/homeassistant/components/hddtemp/sensor.py +++ b/homeassistant/components/hddtemp/sensor.py @@ -88,7 +88,7 @@ class HddTempSensor(Entity): return self._unit @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" if self._details is not None: return {ATTR_DEVICE: self._details[0], ATTR_MODEL: self._details[1]} diff --git a/homeassistant/components/hdmi_cec/__init__.py b/homeassistant/components/hdmi_cec/__init__.py index c9a5d27a3be..2f821c1d3a7 100644 --- a/homeassistant/components/hdmi_cec/__init__.py +++ b/homeassistant/components/hdmi_cec/__init__.py @@ -450,7 +450,7 @@ class CecEntity(Entity): ) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" state_attr = {} if self.vendor_id is not None: diff --git a/homeassistant/components/heos/media_player.py b/homeassistant/components/heos/media_player.py index 15d3c4573db..6e271bf60cd 100644 --- a/homeassistant/components/heos/media_player.py +++ b/homeassistant/components/heos/media_player.py @@ -262,7 +262,7 @@ class HeosMediaPlayer(MediaPlayerEntity): } @property - def device_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict: """Get additional attribute about the state.""" return { "media_album_id": self._player.now_playing_media.album_id, diff --git a/homeassistant/components/here_travel_time/sensor.py b/homeassistant/components/here_travel_time/sensor.py index e9506fceed5..e9b3f4ff9a4 100644 --- a/homeassistant/components/here_travel_time/sensor.py +++ b/homeassistant/components/here_travel_time/sensor.py @@ -271,7 +271,7 @@ class HERETravelTimeSensor(Entity): return self._name @property - def device_state_attributes( + def extra_state_attributes( self, ) -> Optional[Dict[str, Union[None, float, str, bool]]]: """Return the state attributes.""" diff --git a/homeassistant/components/hikvision/binary_sensor.py b/homeassistant/components/hikvision/binary_sensor.py index 90c4b6ce8b9..0d57278c826 100644 --- a/homeassistant/components/hikvision/binary_sensor.py +++ b/homeassistant/components/hikvision/binary_sensor.py @@ -252,7 +252,7 @@ class HikvisionBinarySensor(BinarySensorEntity): return False @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" attr = {ATTR_LAST_TRIP_TIME: self._sensor_last_update()} diff --git a/homeassistant/components/history_stats/sensor.py b/homeassistant/components/history_stats/sensor.py index 6778e893f6f..7658146d102 100644 --- a/homeassistant/components/history_stats/sensor.py +++ b/homeassistant/components/history_stats/sensor.py @@ -174,7 +174,7 @@ class HistoryStatsSensor(Entity): return self._unit_of_measurement @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" if self.value is None: return {} diff --git a/homeassistant/components/hive/binary_sensor.py b/homeassistant/components/hive/binary_sensor.py index 41f1dacc8f3..eed08c45b3a 100644 --- a/homeassistant/components/hive/binary_sensor.py +++ b/homeassistant/components/hive/binary_sensor.py @@ -69,7 +69,7 @@ class HiveBinarySensorEntity(HiveEntity, BinarySensorEntity): return True @property - def device_state_attributes(self): + def extra_state_attributes(self): """Show Device Attributes.""" return { ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE), diff --git a/homeassistant/components/hive/climate.py b/homeassistant/components/hive/climate.py index f1901147f17..c0b33dbb3ae 100644 --- a/homeassistant/components/hive/climate.py +++ b/homeassistant/components/hive/climate.py @@ -94,7 +94,7 @@ class HiveClimateEntity(HiveEntity, ClimateEntity): return self.device["deviceData"]["online"] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Show Device Attributes.""" return {ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE)} diff --git a/homeassistant/components/hive/light.py b/homeassistant/components/hive/light.py index f458c27d019..12779ef9d2e 100644 --- a/homeassistant/components/hive/light.py +++ b/homeassistant/components/hive/light.py @@ -56,7 +56,7 @@ class HiveDeviceLight(HiveEntity, LightEntity): return self.device["deviceData"]["online"] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Show Device Attributes.""" return { ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE), diff --git a/homeassistant/components/hive/sensor.py b/homeassistant/components/hive/sensor.py index e828dff9b4e..fe413a35b2f 100644 --- a/homeassistant/components/hive/sensor.py +++ b/homeassistant/components/hive/sensor.py @@ -68,7 +68,7 @@ class HiveSensorEntity(HiveEntity, Entity): return self.device["status"]["state"] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE)} diff --git a/homeassistant/components/hive/switch.py b/homeassistant/components/hive/switch.py index 8ab820589cf..821f48dbf97 100644 --- a/homeassistant/components/hive/switch.py +++ b/homeassistant/components/hive/switch.py @@ -47,7 +47,7 @@ class HiveDevicePlug(HiveEntity, SwitchEntity): return self.device["deviceData"].get("online") @property - def device_state_attributes(self): + def extra_state_attributes(self): """Show Device Attributes.""" return { ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE), diff --git a/homeassistant/components/homeassistant/scene.py b/homeassistant/components/homeassistant/scene.py index 1ff3915f121..cca2c601493 100644 --- a/homeassistant/components/homeassistant/scene.py +++ b/homeassistant/components/homeassistant/scene.py @@ -298,7 +298,7 @@ class HomeAssistantScene(Scene): return self.scene_config.id @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the scene state attributes.""" attributes = {ATTR_ENTITY_ID: list(self.scene_config.states)} unique_id = self.unique_id diff --git a/homeassistant/components/homekit_controller/air_quality.py b/homeassistant/components/homekit_controller/air_quality.py index 896034a2ca0..2a162eb2b2a 100644 --- a/homeassistant/components/homekit_controller/air_quality.py +++ b/homeassistant/components/homekit_controller/air_quality.py @@ -69,7 +69,7 @@ class HomeAirQualitySensor(HomeKitEntity, AirQualityEntity): return self.service.value(CharacteristicsTypes.DENSITY_VOC) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" data = {"air_quality_text": self.air_quality_text} diff --git a/homeassistant/components/homekit_controller/alarm_control_panel.py b/homeassistant/components/homekit_controller/alarm_control_panel.py index 621fb01ff74..c40252c9fdc 100644 --- a/homeassistant/components/homekit_controller/alarm_control_panel.py +++ b/homeassistant/components/homekit_controller/alarm_control_panel.py @@ -105,7 +105,7 @@ class HomeKitAlarmControlPanelEntity(HomeKitEntity, AlarmControlPanelEntity): ) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the optional state attributes.""" battery_level = self.service.value(CharacteristicsTypes.BATTERY_LEVEL) diff --git a/homeassistant/components/homekit_controller/cover.py b/homeassistant/components/homekit_controller/cover.py index 6c945c81115..dd25e32b3c4 100644 --- a/homeassistant/components/homekit_controller/cover.py +++ b/homeassistant/components/homekit_controller/cover.py @@ -108,7 +108,7 @@ class HomeKitGarageDoorCover(HomeKitEntity, CoverEntity): ) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the optional state attributes.""" obstruction_detected = self.service.value( CharacteristicsTypes.OBSTRUCTION_DETECTED @@ -235,7 +235,7 @@ class HomeKitWindowCover(HomeKitEntity, CoverEntity): ) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the optional state attributes.""" obstruction_detected = self.service.value( CharacteristicsTypes.OBSTRUCTION_DETECTED diff --git a/homeassistant/components/homekit_controller/lock.py b/homeassistant/components/homekit_controller/lock.py index 8ac7fd608fd..09c02ce0ff9 100644 --- a/homeassistant/components/homekit_controller/lock.py +++ b/homeassistant/components/homekit_controller/lock.py @@ -63,7 +63,7 @@ class HomeKitLock(HomeKitEntity, LockEntity): ) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the optional state attributes.""" attributes = {} diff --git a/homeassistant/components/homekit_controller/switch.py b/homeassistant/components/homekit_controller/switch.py index b9d0b273cb1..36ed379bc80 100644 --- a/homeassistant/components/homekit_controller/switch.py +++ b/homeassistant/components/homekit_controller/switch.py @@ -39,7 +39,7 @@ class HomeKitSwitch(HomeKitEntity, SwitchEntity): await self.async_put_characteristics({CharacteristicsTypes.ON: False}) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the optional state attributes.""" outlet_in_use = self.service.value(CharacteristicsTypes.OUTLET_IN_USE) if outlet_in_use is not None: @@ -77,7 +77,7 @@ class HomeKitValve(HomeKitEntity, SwitchEntity): return self.service.value(CharacteristicsTypes.ACTIVE) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the optional state attributes.""" attrs = {} diff --git a/homeassistant/components/homematicip_cloud/binary_sensor.py b/homeassistant/components/homematicip_cloud/binary_sensor.py index 4f1ae523ecc..0d21967b242 100644 --- a/homeassistant/components/homematicip_cloud/binary_sensor.py +++ b/homeassistant/components/homematicip_cloud/binary_sensor.py @@ -210,9 +210,9 @@ class HomematicipBaseActionSensor(HomematicipGenericEntity, BinarySensorEntity): return self._device.accelerationSensorTriggered @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the acceleration sensor.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes for attr, attr_key in SAM_DEVICE_ATTRIBUTES.items(): attr_value = getattr(self._device, attr, None) @@ -285,9 +285,9 @@ class HomematicipShutterContact(HomematicipMultiContactInterface, BinarySensorEn return DEVICE_CLASS_DOOR @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the Shutter Contact.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes if self.has_additional_state: window_state = getattr(self._device, "windowState", None) @@ -412,9 +412,9 @@ class HomematicipSunshineSensor(HomematicipGenericEntity, BinarySensorEntity): return self._device.sunshine @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the illuminance sensor.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes today_sunshine_duration = getattr(self._device, "todaySunshineDuration", None) if today_sunshine_duration: @@ -482,9 +482,9 @@ class HomematicipSecurityZoneSensorGroup(HomematicipGenericEntity, BinarySensorE return True @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the security zone group.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes for attr, attr_key in GROUP_ATTRIBUTES.items(): attr_value = getattr(self._device, attr, None) @@ -526,9 +526,9 @@ class HomematicipSecuritySensorGroup( super().__init__(hap, device, post="Sensors") @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the security group.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes smoke_detector_at = getattr(self._device, "smokeDetectorAlarmType", None) if smoke_detector_at: diff --git a/homeassistant/components/homematicip_cloud/climate.py b/homeassistant/components/homematicip_cloud/climate.py index dcd5aeb284e..c09bd2cc53e 100644 --- a/homeassistant/components/homematicip_cloud/climate.py +++ b/homeassistant/components/homematicip_cloud/climate.py @@ -237,9 +237,9 @@ class HomematicipHeatingGroup(HomematicipGenericEntity, ClimateEntity): await self._device.set_active_profile(profile_idx) @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the access point.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes if self._device.controlMode == HMIP_ECO_CM: if self._indoor_climate.absenceType in [ diff --git a/homeassistant/components/homematicip_cloud/generic_entity.py b/homeassistant/components/homematicip_cloud/generic_entity.py index a1e13658d20..345446e78b2 100644 --- a/homeassistant/components/homematicip_cloud/generic_entity.py +++ b/homeassistant/components/homematicip_cloud/generic_entity.py @@ -232,7 +232,7 @@ class HomematicipGenericEntity(Entity): return None @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the generic entity.""" state_attr = {} diff --git a/homeassistant/components/homematicip_cloud/light.py b/homeassistant/components/homematicip_cloud/light.py index 1909ff818b9..c453cf516dc 100644 --- a/homeassistant/components/homematicip_cloud/light.py +++ b/homeassistant/components/homematicip_cloud/light.py @@ -90,9 +90,9 @@ class HomematicipLightMeasuring(HomematicipLight): """Representation of the HomematicIP measuring light.""" @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the light.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes current_power_w = self._device.currentPowerConsumption if current_power_w > 0.05: @@ -206,9 +206,9 @@ class HomematicipNotificationLight(HomematicipGenericEntity, LightEntity): return self._color_switcher.get(simple_rgb_color, [0.0, 0.0]) @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the notification light sensor.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes if self.is_on: state_attr[ATTR_COLOR_NAME] = self._func_channel.simpleRGBColorState diff --git a/homeassistant/components/homematicip_cloud/sensor.py b/homeassistant/components/homematicip_cloud/sensor.py index 9e202302c10..9f7c7517c3a 100644 --- a/homeassistant/components/homematicip_cloud/sensor.py +++ b/homeassistant/components/homematicip_cloud/sensor.py @@ -222,9 +222,9 @@ class HomematicipTemperatureSensor(HomematicipGenericEntity): return TEMP_CELSIUS @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the windspeed sensor.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes temperature_offset = getattr(self._device, "temperatureOffset", None) if temperature_offset: @@ -259,9 +259,9 @@ class HomematicipIlluminanceSensor(HomematicipGenericEntity): return LIGHT_LUX @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the wind speed sensor.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes for attr, attr_key in ILLUMINATION_DEVICE_ATTRIBUTES.items(): attr_value = getattr(self._device, attr, None) @@ -312,9 +312,9 @@ class HomematicipWindspeedSensor(HomematicipGenericEntity): return SPEED_KILOMETERS_PER_HOUR @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the wind speed sensor.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes wind_direction = getattr(self._device, "windDirection", None) if wind_direction is not None: @@ -354,9 +354,9 @@ class HomematicipPassageDetectorDeltaCounter(HomematicipGenericEntity): return self._device.leftRightCounterDelta @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the delta counter.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes state_attr[ATTR_LEFT_COUNTER] = self._device.leftCounter state_attr[ATTR_RIGHT_COUNTER] = self._device.rightCounter diff --git a/homeassistant/components/homematicip_cloud/switch.py b/homeassistant/components/homematicip_cloud/switch.py index f8c37d336d5..e75615bf336 100644 --- a/homeassistant/components/homematicip_cloud/switch.py +++ b/homeassistant/components/homematicip_cloud/switch.py @@ -141,9 +141,9 @@ class HomematicipGroupSwitch(HomematicipGenericEntity, SwitchEntity): return True @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the state attributes of the switch-group.""" - state_attr = super().device_state_attributes + state_attr = super().extra_state_attributes if self._device.unreach: state_attr[ATTR_GROUP_MEMBER_UNREACHABLE] = True diff --git a/homeassistant/components/homeworks/light.py b/homeassistant/components/homeworks/light.py index a5a3b9ed077..f62477148f7 100644 --- a/homeassistant/components/homeworks/light.py +++ b/homeassistant/components/homeworks/light.py @@ -82,7 +82,7 @@ class HomeworksLight(HomeworksDevice, LightEntity): ) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Supported attributes.""" return {"homeworks_address": self._addr} diff --git a/homeassistant/components/honeywell/climate.py b/homeassistant/components/honeywell/climate.py index 4b87350aec8..a825916628d 100644 --- a/homeassistant/components/honeywell/climate.py +++ b/homeassistant/components/honeywell/climate.py @@ -197,7 +197,7 @@ class HoneywellUSThermostat(ClimateEntity): return self._device.name @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the device specific state attributes.""" data = {} data[ATTR_FAN_ACTION] = "running" if self._device.fan_running else "idle" diff --git a/homeassistant/components/hp_ilo/sensor.py b/homeassistant/components/hp_ilo/sensor.py index da597acb8b7..0126ab780ce 100644 --- a/homeassistant/components/hp_ilo/sensor.py +++ b/homeassistant/components/hp_ilo/sensor.py @@ -144,7 +144,7 @@ class HpIloSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return self._state_attributes diff --git a/homeassistant/components/huawei_lte/binary_sensor.py b/homeassistant/components/huawei_lte/binary_sensor.py index ea9d68bc843..525dd3352e7 100644 --- a/homeassistant/components/huawei_lte/binary_sensor.py +++ b/homeassistant/components/huawei_lte/binary_sensor.py @@ -142,7 +142,7 @@ class HuaweiLteMobileConnectionBinarySensor(HuaweiLteBaseBinarySensor): return True @property - def device_state_attributes(self) -> Optional[Dict[str, Any]]: + def extra_state_attributes(self) -> Optional[Dict[str, Any]]: """Get additional attributes related to connection status.""" attributes = {} if self._raw_state in CONNECTION_STATE_ATTRIBUTES: diff --git a/homeassistant/components/huawei_lte/device_tracker.py b/homeassistant/components/huawei_lte/device_tracker.py index 52e59b713dd..3e889263b76 100644 --- a/homeassistant/components/huawei_lte/device_tracker.py +++ b/homeassistant/components/huawei_lte/device_tracker.py @@ -126,11 +126,11 @@ class HuaweiLteScannerEntity(HuaweiLteBaseEntity, ScannerEntity): _is_connected: bool = attr.ib(init=False, default=False) _hostname: Optional[str] = attr.ib(init=False, default=None) - _device_state_attributes: Dict[str, Any] = attr.ib(init=False, factory=dict) + _extra_state_attributes: Dict[str, Any] = attr.ib(init=False, factory=dict) def __attrs_post_init__(self) -> None: """Initialize internal state.""" - self._device_state_attributes["mac_address"] = self.mac + self._extra_state_attributes["mac_address"] = self.mac @property def _entity_name(self) -> str: @@ -151,9 +151,9 @@ class HuaweiLteScannerEntity(HuaweiLteBaseEntity, ScannerEntity): return self._is_connected @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Get additional attributes related to entity state.""" - return self._device_state_attributes + return self._extra_state_attributes async def async_update(self) -> None: """Update state.""" @@ -162,6 +162,6 @@ class HuaweiLteScannerEntity(HuaweiLteBaseEntity, ScannerEntity): self._is_connected = host is not None if host is not None: self._hostname = host.get("HostName") - self._device_state_attributes = { + self._extra_state_attributes = { _better_snakecase(k): v for k, v in host.items() if k != "HostName" } diff --git a/homeassistant/components/hue/binary_sensor.py b/homeassistant/components/hue/binary_sensor.py index cfbe041aafe..e408e995ad4 100644 --- a/homeassistant/components/hue/binary_sensor.py +++ b/homeassistant/components/hue/binary_sensor.py @@ -31,9 +31,9 @@ class HuePresence(GenericZLLSensor, BinarySensorEntity): return self.sensor.presence @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" - attributes = super().device_state_attributes + attributes = super().extra_state_attributes if "sensitivity" in self.sensor.config: attributes["sensitivity"] = self.sensor.config["sensitivity"] if "sensitivitymax" in self.sensor.config: diff --git a/homeassistant/components/hue/light.py b/homeassistant/components/hue/light.py index 6384e47b45e..8adde810fbe 100644 --- a/homeassistant/components/hue/light.py +++ b/homeassistant/components/hue/light.py @@ -535,7 +535,7 @@ class HueLight(CoordinatorEntity, LightEntity): await self.coordinator.async_request_refresh() @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" if not self.is_group: return {} diff --git a/homeassistant/components/hue/sensor.py b/homeassistant/components/hue/sensor.py index f5911bbb50c..a3c5fcc3fa7 100644 --- a/homeassistant/components/hue/sensor.py +++ b/homeassistant/components/hue/sensor.py @@ -58,9 +58,9 @@ class HueLightLevel(GenericHueGaugeSensorEntity): return round(float(10 ** ((self.sensor.lightlevel - 1) / 10000)), 2) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" - attributes = super().device_state_attributes + attributes = super().extra_state_attributes attributes.update( { "lightlevel": self.sensor.lightlevel, diff --git a/homeassistant/components/hue/sensor_base.py b/homeassistant/components/hue/sensor_base.py index 263140464aa..9f764e04d28 100644 --- a/homeassistant/components/hue/sensor_base.py +++ b/homeassistant/components/hue/sensor_base.py @@ -197,6 +197,6 @@ class GenericZLLSensor(GenericHueSensor): """Representation of a Hue-brand, physical sensor.""" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return {"battery_level": self.sensor.battery} diff --git a/homeassistant/components/hunterdouglas_powerview/cover.py b/homeassistant/components/hunterdouglas_powerview/cover.py index e90b315fd16..9ac45c6bd9a 100644 --- a/homeassistant/components/hunterdouglas_powerview/cover.py +++ b/homeassistant/components/hunterdouglas_powerview/cover.py @@ -111,7 +111,7 @@ class PowerViewShade(ShadeEntity, CoverEntity): self._current_cover_position = MIN_POSITION @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {STATE_ATTRIBUTE_ROOM_NAME: self._room_name} diff --git a/homeassistant/components/hunterdouglas_powerview/scene.py b/homeassistant/components/hunterdouglas_powerview/scene.py index 33c7e7129fc..c30cde8d043 100644 --- a/homeassistant/components/hunterdouglas_powerview/scene.py +++ b/homeassistant/components/hunterdouglas_powerview/scene.py @@ -71,7 +71,7 @@ class PowerViewScene(HDEntity, Scene): return self._scene.name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {STATE_ATTRIBUTE_ROOM_NAME: self._room_name} diff --git a/homeassistant/components/hvv_departures/binary_sensor.py b/homeassistant/components/hvv_departures/binary_sensor.py index f625ef7c344..45ac0e45ad9 100644 --- a/homeassistant/components/hvv_departures/binary_sensor.py +++ b/homeassistant/components/hvv_departures/binary_sensor.py @@ -174,7 +174,7 @@ class HvvDepartureBinarySensor(CoordinatorEntity, BinarySensorEntity): return DEVICE_CLASS_PROBLEM @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if not ( self.coordinator.last_update_success diff --git a/homeassistant/components/hvv_departures/sensor.py b/homeassistant/components/hvv_departures/sensor.py index d6957e6beec..bbabb1b8caa 100644 --- a/homeassistant/components/hvv_departures/sensor.py +++ b/homeassistant/components/hvv_departures/sensor.py @@ -199,6 +199,6 @@ class HVVDepartureSensor(Entity): return DEVICE_CLASS_TIMESTAMP @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return self.attr diff --git a/homeassistant/components/hydrawise/__init__.py b/homeassistant/components/hydrawise/__init__.py index 08827baae68..6fa05ebef16 100644 --- a/homeassistant/components/hydrawise/__init__.py +++ b/homeassistant/components/hydrawise/__init__.py @@ -151,7 +151,7 @@ class HydrawiseEntity(Entity): ] @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION, "identifier": self.data.get("relay")} diff --git a/homeassistant/components/icloud/device_tracker.py b/homeassistant/components/icloud/device_tracker.py index 59554c001ef..77fcf0a3039 100644 --- a/homeassistant/components/icloud/device_tracker.py +++ b/homeassistant/components/icloud/device_tracker.py @@ -108,7 +108,7 @@ class IcloudTrackerEntity(TrackerEntity): return icon_for_icloud_device(self._device) @property - def device_state_attributes(self) -> Dict[str, any]: + def extra_state_attributes(self) -> Dict[str, any]: """Return the device state attributes.""" return self._device.state_attributes diff --git a/homeassistant/components/icloud/sensor.py b/homeassistant/components/icloud/sensor.py index 859148d8190..9a7c568112d 100644 --- a/homeassistant/components/icloud/sensor.py +++ b/homeassistant/components/icloud/sensor.py @@ -91,7 +91,7 @@ class IcloudDeviceBatterySensor(Entity): ) @property - def device_state_attributes(self) -> Dict[str, any]: + def extra_state_attributes(self) -> Dict[str, any]: """Return default attributes for the iCloud device entity.""" return self._device.state_attributes diff --git a/homeassistant/components/ign_sismologia/geo_location.py b/homeassistant/components/ign_sismologia/geo_location.py index 0db580701d0..fc9bdcbe87e 100644 --- a/homeassistant/components/ign_sismologia/geo_location.py +++ b/homeassistant/components/ign_sismologia/geo_location.py @@ -238,7 +238,7 @@ class IgnSismologiaLocationEvent(GeolocationEvent): return LENGTH_KILOMETERS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" attributes = {} for key, value in ( diff --git a/homeassistant/components/ihc/ihcdevice.py b/homeassistant/components/ihc/ihcdevice.py index 0b3dc763ca0..e351d2f38ea 100644 --- a/homeassistant/components/ihc/ihcdevice.py +++ b/homeassistant/components/ihc/ihcdevice.py @@ -42,7 +42,7 @@ class IHCDevice(Entity): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if not self.info: return {} diff --git a/homeassistant/components/imap_email_content/sensor.py b/homeassistant/components/imap_email_content/sensor.py index 04d4ca97c5a..84dc527ac52 100644 --- a/homeassistant/components/imap_email_content/sensor.py +++ b/homeassistant/components/imap_email_content/sensor.py @@ -171,7 +171,7 @@ class EmailContentSensor(Entity): return self._message @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return other state attributes for the message.""" return self._state_attributes diff --git a/homeassistant/components/incomfort/binary_sensor.py b/homeassistant/components/incomfort/binary_sensor.py index bf1340fb235..86cdf2d8687 100644 --- a/homeassistant/components/incomfort/binary_sensor.py +++ b/homeassistant/components/incomfort/binary_sensor.py @@ -40,6 +40,6 @@ class IncomfortFailed(IncomfortChild, BinarySensorEntity): return self._heater.status["is_failed"] @property - def device_state_attributes(self) -> Optional[Dict[str, Any]]: + def extra_state_attributes(self) -> Optional[Dict[str, Any]]: """Return the device state attributes.""" return {"fault_code": self._heater.status["fault_code"]} diff --git a/homeassistant/components/incomfort/climate.py b/homeassistant/components/incomfort/climate.py index 274308efe06..c3db86a79ac 100644 --- a/homeassistant/components/incomfort/climate.py +++ b/homeassistant/components/incomfort/climate.py @@ -39,7 +39,7 @@ class InComfortClimate(IncomfortChild, ClimateEntity): self._room = room @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the device state attributes.""" return {"status": self._room.status} diff --git a/homeassistant/components/incomfort/sensor.py b/homeassistant/components/incomfort/sensor.py index 692eecf2317..0672d19b2a9 100644 --- a/homeassistant/components/incomfort/sensor.py +++ b/homeassistant/components/incomfort/sensor.py @@ -95,6 +95,6 @@ class IncomfortTemperature(IncomfortSensor): self._unit_of_measurement = TEMP_CELSIUS @property - def device_state_attributes(self) -> Optional[Dict[str, Any]]: + def extra_state_attributes(self) -> Optional[Dict[str, Any]]: """Return the device state attributes.""" return {self._attr: self._heater.status[self._attr]} diff --git a/homeassistant/components/incomfort/water_heater.py b/homeassistant/components/incomfort/water_heater.py index da6e6d89315..b3db66bd93d 100644 --- a/homeassistant/components/incomfort/water_heater.py +++ b/homeassistant/components/incomfort/water_heater.py @@ -50,7 +50,7 @@ class IncomfortWaterHeater(IncomfortEntity, WaterHeaterEntity): return "mdi:thermometer-lines" @property - def device_state_attributes(self) -> Dict[str, Any]: + def extra_state_attributes(self) -> Dict[str, Any]: """Return the device state attributes.""" return {k: v for k, v in self._heater.status.items() if k in HEATER_ATTRS} diff --git a/homeassistant/components/insteon/climate.py b/homeassistant/components/insteon/climate.py index c699e76c4f3..536c30bc6b9 100644 --- a/homeassistant/components/insteon/climate.py +++ b/homeassistant/components/insteon/climate.py @@ -177,9 +177,9 @@ class InsteonClimateEntity(InsteonEntity, ClimateEntity): return CURRENT_HVAC_IDLE @property - def device_state_attributes(self): + def extra_state_attributes(self): """Provide attributes for display on device card.""" - attr = super().device_state_attributes + attr = super().extra_state_attributes humidifier = "off" if self._insteon_device.groups[DEHUMIDIFYING].value: humidifier = "dehumidifying" diff --git a/homeassistant/components/insteon/insteon_entity.py b/homeassistant/components/insteon/insteon_entity.py index 2234eb4750c..3f83440d690 100644 --- a/homeassistant/components/insteon/insteon_entity.py +++ b/homeassistant/components/insteon/insteon_entity.py @@ -75,7 +75,7 @@ class InsteonEntity(Entity): return f"{description} {self._insteon_device.address}{extension}" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Provide attributes for display on device card.""" return {"insteon_address": self.address, "insteon_group": self.group} diff --git a/homeassistant/components/integration/sensor.py b/homeassistant/components/integration/sensor.py index 6c59035adb4..3be60dcd7f7 100644 --- a/homeassistant/components/integration/sensor.py +++ b/homeassistant/components/integration/sensor.py @@ -201,7 +201,7 @@ class IntegrationSensor(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/intesishome/climate.py b/homeassistant/components/intesishome/climate.py index a41161c7a6e..d58efddeb3c 100644 --- a/homeassistant/components/intesishome/climate.py +++ b/homeassistant/components/intesishome/climate.py @@ -212,7 +212,7 @@ class IntesisAC(ClimateEntity): return TEMP_CELSIUS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device specific state attributes.""" attrs = {} if self._outdoor_temp: diff --git a/homeassistant/components/ios/sensor.py b/homeassistant/components/ios/sensor.py index ccbc118a681..a8cffacabe9 100644 --- a/homeassistant/components/ios/sensor.py +++ b/homeassistant/components/ios/sensor.py @@ -88,7 +88,7 @@ class IOSSensor(Entity): return self._unit_of_measurement @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" device = self._device[ios.ATTR_DEVICE] device_battery = self._device[ios.ATTR_BATTERY] diff --git a/homeassistant/components/iota/__init__.py b/homeassistant/components/iota/__init__.py index 41c5ad35d83..04db9140122 100644 --- a/homeassistant/components/iota/__init__.py +++ b/homeassistant/components/iota/__init__.py @@ -67,7 +67,7 @@ class IotaDevice(Entity): return self._name @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the device.""" return {CONF_WALLET_NAME: self._name} diff --git a/homeassistant/components/iota/sensor.py b/homeassistant/components/iota/sensor.py index a6f689e8c2d..751324d61b1 100644 --- a/homeassistant/components/iota/sensor.py +++ b/homeassistant/components/iota/sensor.py @@ -85,7 +85,7 @@ class IotaNodeSensor(IotaDevice): 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/iperf3/sensor.py b/homeassistant/components/iperf3/sensor.py index 749a3e83217..a8a79008817 100644 --- a/homeassistant/components/iperf3/sensor.py +++ b/homeassistant/components/iperf3/sensor.py @@ -55,7 +55,7 @@ class Iperf3Sensor(RestoreEntity): return 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/ipp/sensor.py b/homeassistant/components/ipp/sensor.py index a278f6e8ef9..b24e05f2720 100644 --- a/homeassistant/components/ipp/sensor.py +++ b/homeassistant/components/ipp/sensor.py @@ -117,7 +117,7 @@ class IPPMarkerSensor(IPPSensor): ) @property - def device_state_attributes(self) -> Optional[Dict[str, Any]]: + def extra_state_attributes(self) -> Optional[Dict[str, Any]]: """Return the state attributes of the entity.""" return { ATTR_MARKER_HIGH_LEVEL: self.coordinator.data.markers[ @@ -160,7 +160,7 @@ class IPPPrinterSensor(IPPSensor): ) @property - def device_state_attributes(self) -> Optional[Dict[str, Any]]: + def extra_state_attributes(self) -> Optional[Dict[str, Any]]: """Return the state attributes of the entity.""" return { ATTR_INFO: self.coordinator.data.info.printer_info, diff --git a/homeassistant/components/iqvia/__init__.py b/homeassistant/components/iqvia/__init__.py index 4dc066d7629..962f13ca07e 100644 --- a/homeassistant/components/iqvia/__init__.py +++ b/homeassistant/components/iqvia/__init__.py @@ -123,7 +123,7 @@ class IQVIAEntity(CoordinatorEntity): self._type = sensor_type @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return self._attrs diff --git a/homeassistant/components/irish_rail_transport/sensor.py b/homeassistant/components/irish_rail_transport/sensor.py index fba69a6f578..bd277020125 100644 --- a/homeassistant/components/irish_rail_transport/sensor.py +++ b/homeassistant/components/irish_rail_transport/sensor.py @@ -89,7 +89,7 @@ class IrishRailTransportSensor(Entity): return self._state @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self._times: next_up = "None" diff --git a/homeassistant/components/iss/binary_sensor.py b/homeassistant/components/iss/binary_sensor.py index e1f0d7a19ce..787d7471d43 100644 --- a/homeassistant/components/iss/binary_sensor.py +++ b/homeassistant/components/iss/binary_sensor.py @@ -79,7 +79,7 @@ class IssBinarySensor(BinarySensorEntity): return DEFAULT_DEVICE_CLASS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" if self.iss_data: attrs = { diff --git a/homeassistant/components/isy994/binary_sensor.py b/homeassistant/components/isy994/binary_sensor.py index e8c08d98aa7..807f99734b7 100644 --- a/homeassistant/components/isy994/binary_sensor.py +++ b/homeassistant/components/isy994/binary_sensor.py @@ -455,9 +455,9 @@ class ISYBinarySensorHeartbeat(ISYNodeEntity, BinarySensorEntity): return DEVICE_CLASS_BATTERY @property - def device_state_attributes(self): + def extra_state_attributes(self): """Get the state attributes for the device.""" - attr = super().device_state_attributes + attr = super().extra_state_attributes attr["parent_entity_id"] = self._parent_device.entity_id return attr diff --git a/homeassistant/components/isy994/light.py b/homeassistant/components/isy994/light.py index 7ff44863f6b..04800a3f211 100644 --- a/homeassistant/components/isy994/light.py +++ b/homeassistant/components/isy994/light.py @@ -98,9 +98,9 @@ class ISYLightEntity(ISYNodeEntity, LightEntity, RestoreEntity): _LOGGER.debug("Unable to turn on light") @property - def device_state_attributes(self) -> Dict: + def extra_state_attributes(self) -> Dict: """Return the light attributes.""" - attribs = super().device_state_attributes + attribs = super().extra_state_attributes attribs[ATTR_LAST_BRIGHTNESS] = self._last_brightness return attribs diff --git a/homeassistant/components/isy994/sensor.py b/homeassistant/components/isy994/sensor.py index d3d192b1b3b..2f393227df5 100644 --- a/homeassistant/components/isy994/sensor.py +++ b/homeassistant/components/isy994/sensor.py @@ -117,7 +117,7 @@ class ISYSensorVariableEntity(ISYEntity): return convert_isy_value_to_hass(self._node.status, "", self._node.prec) @property - def device_state_attributes(self) -> Dict: + def extra_state_attributes(self) -> Dict: """Get the state attributes for the device.""" return { "init_value": convert_isy_value_to_hass( diff --git a/homeassistant/components/izone/climate.py b/homeassistant/components/izone/climate.py index 77ce9cb2452..53651683725 100644 --- a/homeassistant/components/izone/climate.py +++ b/homeassistant/components/izone/climate.py @@ -282,7 +282,7 @@ class ControllerDevice(ClimateEntity): return PRECISION_TENTHS @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the optional state attributes.""" return { "supply_temperature": show_temp( @@ -660,7 +660,7 @@ class ZoneDevice(ClimateEntity): return self._zone.index @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the optional state attributes.""" return { "airflow_max": self._zone.airflow_max, diff --git a/tests/components/honeywell/test_climate.py b/tests/components/honeywell/test_climate.py index 058988203e5..ee107d4985e 100644 --- a/tests/components/honeywell/test_climate.py +++ b/tests/components/honeywell/test_climate.py @@ -392,10 +392,10 @@ class TestHoneywellUS(unittest.TestCase): ATTR_FAN_MODES: somecomfort.FAN_MODES, ATTR_HVAC_MODES: somecomfort.SYSTEM_MODES, } - assert expected == self.honeywell.device_state_attributes + assert expected == self.honeywell.extra_state_attributes expected["fan"] = "idle" self.device.fan_running = False - assert expected == self.honeywell.device_state_attributes + assert expected == self.honeywell.extra_state_attributes def test_with_no_fan(self): """Test if there is on fan.""" @@ -407,7 +407,7 @@ class TestHoneywellUS(unittest.TestCase): ATTR_FAN_MODES: somecomfort.FAN_MODES, ATTR_HVAC_MODES: somecomfort.SYSTEM_MODES, } - assert expected == self.honeywell.device_state_attributes + assert expected == self.honeywell.extra_state_attributes def test_heat_away_mode(self): """Test setting the heat away mode.""" diff --git a/tests/components/imap_email_content/test_sensor.py b/tests/components/imap_email_content/test_sensor.py index 241dc4dc506..101896f4a33 100644 --- a/tests/components/imap_email_content/test_sensor.py +++ b/tests/components/imap_email_content/test_sensor.py @@ -48,12 +48,12 @@ async def test_allowed_sender(hass): sensor.async_schedule_update_ha_state(True) await hass.async_block_till_done() assert "Test" == sensor.state - assert "Test Message" == sensor.device_state_attributes["body"] - assert "sender@test.com" == sensor.device_state_attributes["from"] - assert "Test" == sensor.device_state_attributes["subject"] + assert "Test Message" == sensor.extra_state_attributes["body"] + assert "sender@test.com" == sensor.extra_state_attributes["from"] + assert "Test" == sensor.extra_state_attributes["subject"] assert ( datetime.datetime(2016, 1, 1, 12, 44, 57) - == sensor.device_state_attributes["date"] + == sensor.extra_state_attributes["date"] ) @@ -84,7 +84,7 @@ async def test_multi_part_with_text(hass): sensor.async_schedule_update_ha_state(True) await hass.async_block_till_done() assert "Link" == sensor.state - assert "Test Message" == sensor.device_state_attributes["body"] + assert "Test Message" == sensor.extra_state_attributes["body"] async def test_multi_part_only_html(hass): @@ -113,7 +113,7 @@ async def test_multi_part_only_html(hass): assert "Link" == sensor.state assert ( "Test Message" - == sensor.device_state_attributes["body"] + == sensor.extra_state_attributes["body"] ) @@ -141,7 +141,7 @@ async def test_multi_part_only_other_text(hass): sensor.async_schedule_update_ha_state(True) await hass.async_block_till_done() assert "Link" == sensor.state - assert "Test Message" == sensor.device_state_attributes["body"] + assert "Test Message" == sensor.extra_state_attributes["body"] async def test_multiple_emails(hass): @@ -183,7 +183,7 @@ async def test_multiple_emails(hass): assert "Test" == states[0].state assert "Test 2" == states[1].state - assert "Test Message 2" == sensor.device_state_attributes["body"] + assert "Test Message 2" == sensor.extra_state_attributes["body"] async def test_sender_not_allowed(hass):