Update integrations f-i to override extra_state_attributes() (#47757)

This commit is contained in:
Erik Montnemery 2021-03-11 16:57:47 +01:00 committed by GitHub
parent 6c084ae6ce
commit af4d06b12e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
119 changed files with 165 additions and 165 deletions

View file

@ -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

View file

@ -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,

View file

@ -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}

View file

@ -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}

View file

@ -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,

View file

@ -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}

View file

@ -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.

View file

@ -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:

View file

@ -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

View file

@ -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:

View file

@ -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 = {}

View file

@ -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 {

View file

@ -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,

View file

@ -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}

View file

@ -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

View file

@ -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 {}

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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"]

View file

@ -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,

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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 = {}

View file

@ -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 {}

View file

@ -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 (

View file

@ -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 (

View file

@ -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")

View file

@ -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}

View file

@ -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}

View file

@ -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 {}

View file

@ -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

View file

@ -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

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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.

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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}

View file

@ -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:

View file

@ -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}

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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}

View file

@ -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}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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,

View file

@ -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:

View file

@ -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]}

View file

@ -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:

View file

@ -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,

View file

@ -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."""

View file

@ -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()}

View file

@ -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 {}

View file

@ -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),

View file

@ -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)}

View file

@ -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),

View file

@ -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)}

View file

@ -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),

View file

@ -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

View file

@ -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}

View file

@ -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)

View file

@ -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

View file

@ -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 = {}

View file

@ -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 = {}

View file

@ -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:

View file

@ -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 [

View file

@ -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 = {}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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}

View file

@ -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"

View file

@ -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

View file

@ -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:

View file

@ -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"
}

View file

@ -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:

View file

@ -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 {}

View file

@ -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,

View file

@ -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}

View file

@ -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}

View file

@ -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}

View file

@ -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

View file

@ -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

View file

@ -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")}

View file

@ -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

View file

@ -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

View file

@ -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 (

View file

@ -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 {}

View file

@ -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

View file

@ -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"]}

View file

@ -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}

View file

@ -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]}

Some files were not shown because too many files have changed in this diff Show more