Update integrations f-i to override extra_state_attributes() (#47757)
This commit is contained in:
parent
6c084ae6ce
commit
af4d06b12e
119 changed files with 165 additions and 165 deletions
|
@ -68,7 +68,7 @@ class FAABinarySensor(CoordinatorEntity, BinarySensorEntity):
|
||||||
return f"{self._id}_{self._sensor_type}"
|
return f"{self._id}_{self._sensor_type}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return attributes for sensor."""
|
"""Return attributes for sensor."""
|
||||||
if self._sensor_type == "GROUND_DELAY":
|
if self._sensor_type == "GROUND_DELAY":
|
||||||
self._attrs["average"] = self.coordinator.data.ground_delay.average
|
self._attrs["average"] = self.coordinator.data.ground_delay.average
|
||||||
|
|
|
@ -263,7 +263,7 @@ class FaceClassifyEntity(ImageProcessingFaceEntity):
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the classifier attributes."""
|
"""Return the classifier attributes."""
|
||||||
return {
|
return {
|
||||||
"matched_faces": self._matched,
|
"matched_faces": self._matched,
|
||||||
|
|
|
@ -506,7 +506,7 @@ class FibaroDevice(Entity):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the device."""
|
"""Return the state attributes of the device."""
|
||||||
attr = {"fibaro_id": self.fibaro_device.id}
|
attr = {"fibaro_id": self.fibaro_device.id}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ class FidoSensor(Entity):
|
||||||
return self._icon
|
return self._icon
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the sensor."""
|
"""Return the state attributes of the sensor."""
|
||||||
return {"number": self._number}
|
return {"number": self._number}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class Filesize(Entity):
|
||||||
return ICON
|
return ICON
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return other details about the sensor state."""
|
"""Return other details about the sensor state."""
|
||||||
return {
|
return {
|
||||||
"path": self._path,
|
"path": self._path,
|
||||||
|
|
|
@ -351,7 +351,7 @@ class SensorFilter(Entity):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the sensor."""
|
"""Return the state attributes of the sensor."""
|
||||||
return {ATTR_ENTITY_ID: self._entity}
|
return {ATTR_ENTITY_ID: self._entity}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ class FinTsAccount(Entity):
|
||||||
return self._currency
|
return self._currency
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> dict:
|
def extra_state_attributes(self) -> dict:
|
||||||
"""Additional attributes of the sensor."""
|
"""Additional attributes of the sensor."""
|
||||||
attributes = {ATTR_ACCOUNT: self._account.iban, ATTR_ACCOUNT_TYPE: "balance"}
|
attributes = {ATTR_ACCOUNT: self._account.iban, ATTR_ACCOUNT_TYPE: "balance"}
|
||||||
if self._client.name:
|
if self._client.name:
|
||||||
|
@ -238,7 +238,7 @@ class FinTsHoldingsAccount(Entity):
|
||||||
return ICON
|
return ICON
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> dict:
|
def extra_state_attributes(self) -> dict:
|
||||||
"""Additional attributes of the sensor.
|
"""Additional attributes of the sensor.
|
||||||
|
|
||||||
Lists each holding of the account with the current value.
|
Lists each holding of the account with the current value.
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ResponseBinarySensor(CoordinatorEntity, BinarySensorEntity):
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return available attributes for binary sensor."""
|
"""Return available attributes for binary sensor."""
|
||||||
attr = {}
|
attr = {}
|
||||||
if not self.coordinator.data:
|
if not self.coordinator.data:
|
||||||
|
|
|
@ -64,7 +64,7 @@ class IncidentsSensor(RestoreEntity):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> object:
|
def extra_state_attributes(self) -> object:
|
||||||
"""Return available attributes for sensor."""
|
"""Return available attributes for sensor."""
|
||||||
attr = {}
|
attr = {}
|
||||||
data = self._state_attributes
|
data = self._state_attributes
|
||||||
|
|
|
@ -73,7 +73,7 @@ class ResponseSwitch(SwitchEntity):
|
||||||
return self._client.on_duty
|
return self._client.on_duty
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> object:
|
def extra_state_attributes(self) -> object:
|
||||||
"""Return available attributes for switch."""
|
"""Return available attributes for switch."""
|
||||||
attr = {}
|
attr = {}
|
||||||
if not self._state_attributes:
|
if not self._state_attributes:
|
||||||
|
|
|
@ -457,7 +457,7 @@ class FitbitSensor(Entity):
|
||||||
return f"mdi:{FITBIT_RESOURCES_LIST[self.resource_type][2]}"
|
return f"mdi:{FITBIT_RESOURCES_LIST[self.resource_type][2]}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
attrs = {}
|
attrs = {}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ class ExchangeRateSensor(Entity):
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
if self.data.rate is not None:
|
if self.data.rate is not None:
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -93,7 +93,7 @@ class Flexit(ClimateEntity):
|
||||||
self._current_operation = self.unit.get_operation
|
self._current_operation = self.unit.get_operation
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return device specific state attributes."""
|
"""Return device specific state attributes."""
|
||||||
return {
|
return {
|
||||||
"filter_hours": self._filter_hours,
|
"filter_hours": self._filter_hours,
|
||||||
|
|
|
@ -186,7 +186,7 @@ class FlicButton(BinarySensorEntity):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return device specific state attributes."""
|
"""Return device specific state attributes."""
|
||||||
return {"address": self.address}
|
return {"address": self.address}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class FlickPricingSensor(Entity):
|
||||||
return UNIT_NAME
|
return UNIT_NAME
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return self._attributes
|
return self._attributes
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ class FloPendingAlertsBinarySensor(FloEntity, BinarySensorEntity):
|
||||||
return self._device.has_alerts
|
return self._device.has_alerts
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
if not self._device.has_alerts:
|
if not self._device.has_alerts:
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -100,7 +100,7 @@ class FluNearYouSensor(CoordinatorEntity):
|
||||||
self._unit = unit
|
self._unit = unit
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
return self._attrs
|
return self._attrs
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ class Folder(Entity):
|
||||||
return self.ICON
|
return self.ICON
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return other details about the sensor state."""
|
"""Return other details about the sensor state."""
|
||||||
return {
|
return {
|
||||||
"path": self._folder_path,
|
"path": self._folder_path,
|
||||||
|
|
|
@ -105,7 +105,7 @@ class FreeboxDevice(ScannerEntity):
|
||||||
return self._icon
|
return self._icon
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, any]:
|
def extra_state_attributes(self) -> Dict[str, any]:
|
||||||
"""Return the attributes."""
|
"""Return the attributes."""
|
||||||
return self._attrs
|
return self._attrs
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ class FreeboxCallSensor(FreeboxSensor):
|
||||||
self._state = len(self._call_list_for_type)
|
self._state = len(self._call_list_for_type)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, any]:
|
def extra_state_attributes(self) -> Dict[str, any]:
|
||||||
"""Return device specific state attributes."""
|
"""Return device specific state attributes."""
|
||||||
return {
|
return {
|
||||||
dt_util.utc_from_timestamp(call["datetime"]).isoformat(): call["name"]
|
dt_util.utc_from_timestamp(call["datetime"]).isoformat(): call["name"]
|
||||||
|
|
|
@ -191,7 +191,7 @@ class FritzboxThermostat(ClimateEntity):
|
||||||
return MAX_TEMPERATURE
|
return MAX_TEMPERATURE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device specific state attributes."""
|
"""Return the device specific state attributes."""
|
||||||
attrs = {
|
attrs = {
|
||||||
ATTR_STATE_BATTERY_LOW: self._device.battery_low,
|
ATTR_STATE_BATTERY_LOW: self._device.battery_low,
|
||||||
|
|
|
@ -80,7 +80,7 @@ class FritzBoxTempSensor(Entity):
|
||||||
self._fritz.login()
|
self._fritz.login()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the device."""
|
"""Return the state attributes of the device."""
|
||||||
attrs = {
|
attrs = {
|
||||||
ATTR_STATE_DEVICE_LOCKED: self._device.device_lock,
|
ATTR_STATE_DEVICE_LOCKED: self._device.device_lock,
|
||||||
|
|
|
@ -93,7 +93,7 @@ class FritzboxSwitch(SwitchEntity):
|
||||||
self._fritz.login()
|
self._fritz.login()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the device."""
|
"""Return the state attributes of the device."""
|
||||||
attrs = {}
|
attrs = {}
|
||||||
attrs[ATTR_STATE_DEVICE_LOCKED] = self._device.device_lock
|
attrs[ATTR_STATE_DEVICE_LOCKED] = self._device.device_lock
|
||||||
|
|
|
@ -169,7 +169,7 @@ class FritzBoxCallSensor(Entity):
|
||||||
return ICON_PHONE
|
return ICON_PHONE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
if self._prefixes:
|
if self._prefixes:
|
||||||
self._attributes[ATTR_PREFIXES] = self._prefixes
|
self._attributes[ATTR_PREFIXES] = self._prefixes
|
||||||
|
|
|
@ -135,7 +135,7 @@ class GaradgetCover(CoverEntity):
|
||||||
return self._available
|
return self._available
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
data = {}
|
data = {}
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ class GarminConnectSensor(Entity):
|
||||||
return self._unit
|
return self._unit
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return attributes for sensor."""
|
"""Return attributes for sensor."""
|
||||||
if not self._data.data:
|
if not self._data.data:
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -213,7 +213,7 @@ class GdacsEvent(GeolocationEvent):
|
||||||
return LENGTH_KILOMETERS
|
return LENGTH_KILOMETERS
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
for key, value in (
|
for key, value in (
|
||||||
|
|
|
@ -129,7 +129,7 @@ class GdacsSensor(Entity):
|
||||||
return DEFAULT_UNIT_OF_MEASUREMENT
|
return DEFAULT_UNIT_OF_MEASUREMENT
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
for key, value in (
|
for key, value in (
|
||||||
|
|
|
@ -72,7 +72,7 @@ class Geizwatch(Entity):
|
||||||
return self._device.prices[0]
|
return self._device.prices[0]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
while len(self._device.prices) < 4:
|
while len(self._device.prices) < 4:
|
||||||
self._device.prices.append("None")
|
self._device.prices.append("None")
|
||||||
|
|
|
@ -250,7 +250,7 @@ class GeniusDevice(GeniusEntity):
|
||||||
self._last_comms = self._state_attr = None
|
self._last_comms = self._state_attr = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, Any]:
|
def extra_state_attributes(self) -> Dict[str, Any]:
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attrs = {}
|
attrs = {}
|
||||||
attrs["assigned_zone"] = self._device.data["assignedZones"][0]["name"]
|
attrs["assigned_zone"] = self._device.data["assignedZones"][0]["name"]
|
||||||
|
@ -317,7 +317,7 @@ class GeniusZone(GeniusEntity):
|
||||||
return self._zone.name
|
return self._zone.name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, Any]:
|
def extra_state_attributes(self) -> Dict[str, Any]:
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
status = {k: v for k, v in self._zone.data.items() if k in GH_ZONE_ATTRS}
|
status = {k: v for k, v in self._zone.data.items() if k in GH_ZONE_ATTRS}
|
||||||
return {"status": status}
|
return {"status": status}
|
||||||
|
|
|
@ -106,7 +106,7 @@ class GeniusIssue(GeniusEntity):
|
||||||
return len(self._issues)
|
return len(self._issues)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, Any]:
|
def extra_state_attributes(self) -> Dict[str, Any]:
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
return {f"{self._level}_list": self._issues}
|
return {f"{self._level}_list": self._issues}
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ class GeoJsonLocationEvent(GeolocationEvent):
|
||||||
return LENGTH_KILOMETERS
|
return LENGTH_KILOMETERS
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
if not self._external_id:
|
if not self._external_id:
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -137,7 +137,7 @@ class GeoRssServiceSensor(Entity):
|
||||||
return DEFAULT_ICON
|
return DEFAULT_ICON
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return self._state_attributes
|
return self._state_attributes
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class GeofencyEntity(TrackerEntity, RestoreEntity):
|
||||||
self._unique_id = device
|
self._unique_id = device
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return device specific attributes."""
|
"""Return device specific attributes."""
|
||||||
return self._attributes
|
return self._attributes
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ class GeonetnzQuakesEvent(GeolocationEvent):
|
||||||
return LENGTH_KILOMETERS
|
return LENGTH_KILOMETERS
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
for key, value in (
|
for key, value in (
|
||||||
|
|
|
@ -130,7 +130,7 @@ class GeonetnzQuakesSensor(Entity):
|
||||||
return DEFAULT_UNIT_OF_MEASUREMENT
|
return DEFAULT_UNIT_OF_MEASUREMENT
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
for key, value in (
|
for key, value in (
|
||||||
|
|
|
@ -149,7 +149,7 @@ class GeonetnzVolcanoSensor(Entity):
|
||||||
return "alert level"
|
return "alert level"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
for key, value in (
|
for key, value in (
|
||||||
|
|
|
@ -131,7 +131,7 @@ class GiosAirQuality(CoordinatorEntity, AirQualityEntity):
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
# Different measuring stations have different sets of sensors. We don't know
|
# Different measuring stations have different sets of sensors. We don't know
|
||||||
# what data we will get.
|
# what data we will get.
|
||||||
|
|
|
@ -119,7 +119,7 @@ class GitHubSensor(Entity):
|
||||||
return self._available
|
return self._available
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
attrs = {
|
attrs = {
|
||||||
ATTR_PATH: self._repository_path,
|
ATTR_PATH: self._repository_path,
|
||||||
|
|
|
@ -99,7 +99,7 @@ class GitLabSensor(Entity):
|
||||||
return self._available
|
return self._available
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {
|
return {
|
||||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||||
|
|
|
@ -76,7 +76,7 @@ class GitterSensor(Entity):
|
||||||
return self._unit_of_measurement
|
return self._unit_of_measurement
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {
|
return {
|
||||||
ATTR_USERNAME: self._username,
|
ATTR_USERNAME: self._username,
|
||||||
|
|
|
@ -122,6 +122,6 @@ class DeviceCover(GoGoGate2Entity, CoverEntity):
|
||||||
await self._api.async_close_door(self._get_door().door_id)
|
await self._api.async_close_door(self._get_door().door_id)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {"door_id": self._get_door().door_id}
|
return {"door_id": self._get_door().door_id}
|
||||||
|
|
|
@ -50,7 +50,7 @@ class DoorSensor(GoGoGate2Entity):
|
||||||
return door.voltage # This is a percentage, not an absolute voltage
|
return door.voltage # This is a percentage, not an absolute voltage
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
door = self._get_door()
|
door = self._get_door()
|
||||||
if door.sensorid is not None:
|
if door.sensorid is not None:
|
||||||
|
|
|
@ -80,7 +80,7 @@ class GoogleCalendarEventDevice(CalendarEventDevice):
|
||||||
self.entity_id = entity_id
|
self.entity_id = entity_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
return {"offset_reached": self._offset_reached}
|
return {"offset_reached": self._offset_reached}
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ class GoogleTravelTimeSensor(Entity):
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
if self._matrix is None:
|
if self._matrix is None:
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -94,7 +94,7 @@ class GpsdSensor(Entity):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the GPS."""
|
"""Return the state attributes of the GPS."""
|
||||||
return {
|
return {
|
||||||
ATTR_LATITUDE: self.agps_thread.data_stream.lat,
|
ATTR_LATITUDE: self.agps_thread.data_stream.lat,
|
||||||
|
|
|
@ -79,7 +79,7 @@ class GPSLoggerEntity(TrackerEntity, RestoreEntity):
|
||||||
return self._battery
|
return self._battery
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return device specific attributes."""
|
"""Return device specific attributes."""
|
||||||
return self._attributes
|
return self._attributes
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ class CurrentSensor(GEMSensor):
|
||||||
return self._sensor.watts
|
return self._sensor.watts
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return total wattseconds in the state dictionary."""
|
"""Return total wattseconds in the state dictionary."""
|
||||||
if not self._sensor:
|
if not self._sensor:
|
||||||
return None
|
return None
|
||||||
|
@ -242,7 +242,7 @@ class PulseCounter(GEMSensor):
|
||||||
return f"{self._counted_quantity}/{self._time_unit}"
|
return f"{self._counted_quantity}/{self._time_unit}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return total pulses in the data dictionary."""
|
"""Return total pulses in the data dictionary."""
|
||||||
if not self._sensor:
|
if not self._sensor:
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -208,7 +208,7 @@ class CoverGroup(GroupEntity, CoverEntity):
|
||||||
return self._tilt_position
|
return self._tilt_position
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes for the cover group."""
|
"""Return the state attributes for the cover group."""
|
||||||
return {ATTR_ENTITY_ID: self._entities}
|
return {ATTR_ENTITY_ID: self._entities}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ class LightGroup(GroupEntity, light.LightEntity):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes for the light group."""
|
"""Return the state attributes for the light group."""
|
||||||
return {ATTR_ENTITY_ID: self._entity_ids}
|
return {ATTR_ENTITY_ID: self._entity_ids}
|
||||||
|
|
||||||
|
|
|
@ -569,7 +569,7 @@ class GTFSDepartureSensor(Entity):
|
||||||
return self._available
|
return self._available
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> dict:
|
def extra_state_attributes(self) -> dict:
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return self._attributes
|
return self._attributes
|
||||||
|
|
||||||
|
|
|
@ -246,7 +246,7 @@ class GuardianEntity(CoordinatorEntity):
|
||||||
return self._device_info
|
return self._device_info
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> dict:
|
def extra_state_attributes(self) -> dict:
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return self._attrs
|
return self._attrs
|
||||||
|
|
||||||
|
|
|
@ -200,7 +200,7 @@ class HabitipyTaskSensor(Entity):
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of all user tasks."""
|
"""Return the state attributes of all user tasks."""
|
||||||
if self._updater.tasks is not None:
|
if self._updater.tasks is not None:
|
||||||
all_received_tasks = self._updater.tasks
|
all_received_tasks = self._updater.tasks
|
||||||
|
|
|
@ -193,7 +193,7 @@ class HarmonyRemote(ConnectionStateMixin, remote.RemoteEntity, RestoreEntity):
|
||||||
return self._data.activity_names
|
return self._data.activity_names
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Add platform specific attributes."""
|
"""Add platform specific attributes."""
|
||||||
return {
|
return {
|
||||||
ATTR_ACTIVITY_STARTING: self._activity_starting,
|
ATTR_ACTIVITY_STARTING: self._activity_starting,
|
||||||
|
|
|
@ -80,7 +80,7 @@ class HaveIBeenPwnedSensor(Entity):
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the attributes of the sensor."""
|
"""Return the attributes of the sensor."""
|
||||||
val = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
val = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||||
if self._email not in self._data.data:
|
if self._email not in self._data.data:
|
||||||
|
|
|
@ -88,7 +88,7 @@ class HddTempSensor(Entity):
|
||||||
return self._unit
|
return self._unit
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the sensor."""
|
"""Return the state attributes of the sensor."""
|
||||||
if self._details is not None:
|
if self._details is not None:
|
||||||
return {ATTR_DEVICE: self._details[0], ATTR_MODEL: self._details[1]}
|
return {ATTR_DEVICE: self._details[0], ATTR_MODEL: self._details[1]}
|
||||||
|
|
|
@ -450,7 +450,7 @@ class CecEntity(Entity):
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
state_attr = {}
|
state_attr = {}
|
||||||
if self.vendor_id is not None:
|
if self.vendor_id is not None:
|
||||||
|
|
|
@ -262,7 +262,7 @@ class HeosMediaPlayer(MediaPlayerEntity):
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> dict:
|
def extra_state_attributes(self) -> dict:
|
||||||
"""Get additional attribute about the state."""
|
"""Get additional attribute about the state."""
|
||||||
return {
|
return {
|
||||||
"media_album_id": self._player.now_playing_media.album_id,
|
"media_album_id": self._player.now_playing_media.album_id,
|
||||||
|
|
|
@ -271,7 +271,7 @@ class HERETravelTimeSensor(Entity):
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(
|
def extra_state_attributes(
|
||||||
self,
|
self,
|
||||||
) -> Optional[Dict[str, Union[None, float, str, bool]]]:
|
) -> Optional[Dict[str, Union[None, float, str, bool]]]:
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
|
|
|
@ -252,7 +252,7 @@ class HikvisionBinarySensor(BinarySensorEntity):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
attr = {ATTR_LAST_TRIP_TIME: self._sensor_last_update()}
|
attr = {ATTR_LAST_TRIP_TIME: self._sensor_last_update()}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ class HistoryStatsSensor(Entity):
|
||||||
return self._unit_of_measurement
|
return self._unit_of_measurement
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the sensor."""
|
"""Return the state attributes of the sensor."""
|
||||||
if self.value is None:
|
if self.value is None:
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -69,7 +69,7 @@ class HiveBinarySensorEntity(HiveEntity, BinarySensorEntity):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Show Device Attributes."""
|
"""Show Device Attributes."""
|
||||||
return {
|
return {
|
||||||
ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE),
|
ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE),
|
||||||
|
|
|
@ -94,7 +94,7 @@ class HiveClimateEntity(HiveEntity, ClimateEntity):
|
||||||
return self.device["deviceData"]["online"]
|
return self.device["deviceData"]["online"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Show Device Attributes."""
|
"""Show Device Attributes."""
|
||||||
return {ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE)}
|
return {ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE)}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class HiveDeviceLight(HiveEntity, LightEntity):
|
||||||
return self.device["deviceData"]["online"]
|
return self.device["deviceData"]["online"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Show Device Attributes."""
|
"""Show Device Attributes."""
|
||||||
return {
|
return {
|
||||||
ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE),
|
ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE),
|
||||||
|
|
|
@ -68,7 +68,7 @@ class HiveSensorEntity(HiveEntity, Entity):
|
||||||
return self.device["status"]["state"]
|
return self.device["status"]["state"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE)}
|
return {ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE)}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class HiveDevicePlug(HiveEntity, SwitchEntity):
|
||||||
return self.device["deviceData"].get("online")
|
return self.device["deviceData"].get("online")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Show Device Attributes."""
|
"""Show Device Attributes."""
|
||||||
return {
|
return {
|
||||||
ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE),
|
ATTR_AVAILABLE: self.attributes.get(ATTR_AVAILABLE),
|
||||||
|
|
|
@ -298,7 +298,7 @@ class HomeAssistantScene(Scene):
|
||||||
return self.scene_config.id
|
return self.scene_config.id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the scene state attributes."""
|
"""Return the scene state attributes."""
|
||||||
attributes = {ATTR_ENTITY_ID: list(self.scene_config.states)}
|
attributes = {ATTR_ENTITY_ID: list(self.scene_config.states)}
|
||||||
unique_id = self.unique_id
|
unique_id = self.unique_id
|
||||||
|
|
|
@ -69,7 +69,7 @@ class HomeAirQualitySensor(HomeKitEntity, AirQualityEntity):
|
||||||
return self.service.value(CharacteristicsTypes.DENSITY_VOC)
|
return self.service.value(CharacteristicsTypes.DENSITY_VOC)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
data = {"air_quality_text": self.air_quality_text}
|
data = {"air_quality_text": self.air_quality_text}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ class HomeKitAlarmControlPanelEntity(HomeKitEntity, AlarmControlPanelEntity):
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the optional state attributes."""
|
"""Return the optional state attributes."""
|
||||||
battery_level = self.service.value(CharacteristicsTypes.BATTERY_LEVEL)
|
battery_level = self.service.value(CharacteristicsTypes.BATTERY_LEVEL)
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ class HomeKitGarageDoorCover(HomeKitEntity, CoverEntity):
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the optional state attributes."""
|
"""Return the optional state attributes."""
|
||||||
obstruction_detected = self.service.value(
|
obstruction_detected = self.service.value(
|
||||||
CharacteristicsTypes.OBSTRUCTION_DETECTED
|
CharacteristicsTypes.OBSTRUCTION_DETECTED
|
||||||
|
@ -235,7 +235,7 @@ class HomeKitWindowCover(HomeKitEntity, CoverEntity):
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the optional state attributes."""
|
"""Return the optional state attributes."""
|
||||||
obstruction_detected = self.service.value(
|
obstruction_detected = self.service.value(
|
||||||
CharacteristicsTypes.OBSTRUCTION_DETECTED
|
CharacteristicsTypes.OBSTRUCTION_DETECTED
|
||||||
|
|
|
@ -63,7 +63,7 @@ class HomeKitLock(HomeKitEntity, LockEntity):
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the optional state attributes."""
|
"""Return the optional state attributes."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ class HomeKitSwitch(HomeKitEntity, SwitchEntity):
|
||||||
await self.async_put_characteristics({CharacteristicsTypes.ON: False})
|
await self.async_put_characteristics({CharacteristicsTypes.ON: False})
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the optional state attributes."""
|
"""Return the optional state attributes."""
|
||||||
outlet_in_use = self.service.value(CharacteristicsTypes.OUTLET_IN_USE)
|
outlet_in_use = self.service.value(CharacteristicsTypes.OUTLET_IN_USE)
|
||||||
if outlet_in_use is not None:
|
if outlet_in_use is not None:
|
||||||
|
@ -77,7 +77,7 @@ class HomeKitValve(HomeKitEntity, SwitchEntity):
|
||||||
return self.service.value(CharacteristicsTypes.ACTIVE)
|
return self.service.value(CharacteristicsTypes.ACTIVE)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the optional state attributes."""
|
"""Return the optional state attributes."""
|
||||||
attrs = {}
|
attrs = {}
|
||||||
|
|
||||||
|
|
|
@ -210,9 +210,9 @@ class HomematicipBaseActionSensor(HomematicipGenericEntity, BinarySensorEntity):
|
||||||
return self._device.accelerationSensorTriggered
|
return self._device.accelerationSensorTriggered
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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():
|
for attr, attr_key in SAM_DEVICE_ATTRIBUTES.items():
|
||||||
attr_value = getattr(self._device, attr, None)
|
attr_value = getattr(self._device, attr, None)
|
||||||
|
@ -285,9 +285,9 @@ class HomematicipShutterContact(HomematicipMultiContactInterface, BinarySensorEn
|
||||||
return DEVICE_CLASS_DOOR
|
return DEVICE_CLASS_DOOR
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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:
|
if self.has_additional_state:
|
||||||
window_state = getattr(self._device, "windowState", None)
|
window_state = getattr(self._device, "windowState", None)
|
||||||
|
@ -412,9 +412,9 @@ class HomematicipSunshineSensor(HomematicipGenericEntity, BinarySensorEntity):
|
||||||
return self._device.sunshine
|
return self._device.sunshine
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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)
|
today_sunshine_duration = getattr(self._device, "todaySunshineDuration", None)
|
||||||
if today_sunshine_duration:
|
if today_sunshine_duration:
|
||||||
|
@ -482,9 +482,9 @@ class HomematicipSecurityZoneSensorGroup(HomematicipGenericEntity, BinarySensorE
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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():
|
for attr, attr_key in GROUP_ATTRIBUTES.items():
|
||||||
attr_value = getattr(self._device, attr, None)
|
attr_value = getattr(self._device, attr, None)
|
||||||
|
@ -526,9 +526,9 @@ class HomematicipSecuritySensorGroup(
|
||||||
super().__init__(hap, device, post="Sensors")
|
super().__init__(hap, device, post="Sensors")
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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)
|
smoke_detector_at = getattr(self._device, "smokeDetectorAlarmType", None)
|
||||||
if smoke_detector_at:
|
if smoke_detector_at:
|
||||||
|
|
|
@ -237,9 +237,9 @@ class HomematicipHeatingGroup(HomematicipGenericEntity, ClimateEntity):
|
||||||
await self._device.set_active_profile(profile_idx)
|
await self._device.set_active_profile(profile_idx)
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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._device.controlMode == HMIP_ECO_CM:
|
||||||
if self._indoor_climate.absenceType in [
|
if self._indoor_climate.absenceType in [
|
||||||
|
|
|
@ -232,7 +232,7 @@ class HomematicipGenericEntity(Entity):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@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."""
|
"""Return the state attributes of the generic entity."""
|
||||||
state_attr = {}
|
state_attr = {}
|
||||||
|
|
||||||
|
|
|
@ -90,9 +90,9 @@ class HomematicipLightMeasuring(HomematicipLight):
|
||||||
"""Representation of the HomematicIP measuring light."""
|
"""Representation of the HomematicIP measuring light."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, Any]:
|
def extra_state_attributes(self) -> Dict[str, Any]:
|
||||||
"""Return the state attributes of the light."""
|
"""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
|
current_power_w = self._device.currentPowerConsumption
|
||||||
if current_power_w > 0.05:
|
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])
|
return self._color_switcher.get(simple_rgb_color, [0.0, 0.0])
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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:
|
if self.is_on:
|
||||||
state_attr[ATTR_COLOR_NAME] = self._func_channel.simpleRGBColorState
|
state_attr[ATTR_COLOR_NAME] = self._func_channel.simpleRGBColorState
|
||||||
|
|
|
@ -222,9 +222,9 @@ class HomematicipTemperatureSensor(HomematicipGenericEntity):
|
||||||
return TEMP_CELSIUS
|
return TEMP_CELSIUS
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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)
|
temperature_offset = getattr(self._device, "temperatureOffset", None)
|
||||||
if temperature_offset:
|
if temperature_offset:
|
||||||
|
@ -259,9 +259,9 @@ class HomematicipIlluminanceSensor(HomematicipGenericEntity):
|
||||||
return LIGHT_LUX
|
return LIGHT_LUX
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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():
|
for attr, attr_key in ILLUMINATION_DEVICE_ATTRIBUTES.items():
|
||||||
attr_value = getattr(self._device, attr, None)
|
attr_value = getattr(self._device, attr, None)
|
||||||
|
@ -312,9 +312,9 @@ class HomematicipWindspeedSensor(HomematicipGenericEntity):
|
||||||
return SPEED_KILOMETERS_PER_HOUR
|
return SPEED_KILOMETERS_PER_HOUR
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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)
|
wind_direction = getattr(self._device, "windDirection", None)
|
||||||
if wind_direction is not None:
|
if wind_direction is not None:
|
||||||
|
@ -354,9 +354,9 @@ class HomematicipPassageDetectorDeltaCounter(HomematicipGenericEntity):
|
||||||
return self._device.leftRightCounterDelta
|
return self._device.leftRightCounterDelta
|
||||||
|
|
||||||
@property
|
@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."""
|
"""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_LEFT_COUNTER] = self._device.leftCounter
|
||||||
state_attr[ATTR_RIGHT_COUNTER] = self._device.rightCounter
|
state_attr[ATTR_RIGHT_COUNTER] = self._device.rightCounter
|
||||||
|
|
|
@ -141,9 +141,9 @@ class HomematicipGroupSwitch(HomematicipGenericEntity, SwitchEntity):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@property
|
@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."""
|
"""Return the state attributes of the switch-group."""
|
||||||
state_attr = super().device_state_attributes
|
state_attr = super().extra_state_attributes
|
||||||
|
|
||||||
if self._device.unreach:
|
if self._device.unreach:
|
||||||
state_attr[ATTR_GROUP_MEMBER_UNREACHABLE] = True
|
state_attr[ATTR_GROUP_MEMBER_UNREACHABLE] = True
|
||||||
|
|
|
@ -82,7 +82,7 @@ class HomeworksLight(HomeworksDevice, LightEntity):
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Supported attributes."""
|
"""Supported attributes."""
|
||||||
return {"homeworks_address": self._addr}
|
return {"homeworks_address": self._addr}
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,7 @@ class HoneywellUSThermostat(ClimateEntity):
|
||||||
return self._device.name
|
return self._device.name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, Any]:
|
def extra_state_attributes(self) -> Dict[str, Any]:
|
||||||
"""Return the device specific state attributes."""
|
"""Return the device specific state attributes."""
|
||||||
data = {}
|
data = {}
|
||||||
data[ATTR_FAN_ACTION] = "running" if self._device.fan_running else "idle"
|
data[ATTR_FAN_ACTION] = "running" if self._device.fan_running else "idle"
|
||||||
|
|
|
@ -144,7 +144,7 @@ class HpIloSensor(Entity):
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
return self._state_attributes
|
return self._state_attributes
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ class HuaweiLteMobileConnectionBinarySensor(HuaweiLteBaseBinarySensor):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@property
|
@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."""
|
"""Get additional attributes related to connection status."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
if self._raw_state in CONNECTION_STATE_ATTRIBUTES:
|
if self._raw_state in CONNECTION_STATE_ATTRIBUTES:
|
||||||
|
|
|
@ -126,11 +126,11 @@ class HuaweiLteScannerEntity(HuaweiLteBaseEntity, ScannerEntity):
|
||||||
|
|
||||||
_is_connected: bool = attr.ib(init=False, default=False)
|
_is_connected: bool = attr.ib(init=False, default=False)
|
||||||
_hostname: Optional[str] = attr.ib(init=False, default=None)
|
_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:
|
def __attrs_post_init__(self) -> None:
|
||||||
"""Initialize internal state."""
|
"""Initialize internal state."""
|
||||||
self._device_state_attributes["mac_address"] = self.mac
|
self._extra_state_attributes["mac_address"] = self.mac
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _entity_name(self) -> str:
|
def _entity_name(self) -> str:
|
||||||
|
@ -151,9 +151,9 @@ class HuaweiLteScannerEntity(HuaweiLteBaseEntity, ScannerEntity):
|
||||||
return self._is_connected
|
return self._is_connected
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, Any]:
|
def extra_state_attributes(self) -> Dict[str, Any]:
|
||||||
"""Get additional attributes related to entity state."""
|
"""Get additional attributes related to entity state."""
|
||||||
return self._device_state_attributes
|
return self._extra_state_attributes
|
||||||
|
|
||||||
async def async_update(self) -> None:
|
async def async_update(self) -> None:
|
||||||
"""Update state."""
|
"""Update state."""
|
||||||
|
@ -162,6 +162,6 @@ class HuaweiLteScannerEntity(HuaweiLteBaseEntity, ScannerEntity):
|
||||||
self._is_connected = host is not None
|
self._is_connected = host is not None
|
||||||
if host is not None:
|
if host is not None:
|
||||||
self._hostname = host.get("HostName")
|
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"
|
_better_snakecase(k): v for k, v in host.items() if k != "HostName"
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,9 @@ class HuePresence(GenericZLLSensor, BinarySensorEntity):
|
||||||
return self.sensor.presence
|
return self.sensor.presence
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = super().device_state_attributes
|
attributes = super().extra_state_attributes
|
||||||
if "sensitivity" in self.sensor.config:
|
if "sensitivity" in self.sensor.config:
|
||||||
attributes["sensitivity"] = self.sensor.config["sensitivity"]
|
attributes["sensitivity"] = self.sensor.config["sensitivity"]
|
||||||
if "sensitivitymax" in self.sensor.config:
|
if "sensitivitymax" in self.sensor.config:
|
||||||
|
|
|
@ -535,7 +535,7 @@ class HueLight(CoordinatorEntity, LightEntity):
|
||||||
await self.coordinator.async_request_refresh()
|
await self.coordinator.async_request_refresh()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
if not self.is_group:
|
if not self.is_group:
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -58,9 +58,9 @@ class HueLightLevel(GenericHueGaugeSensorEntity):
|
||||||
return round(float(10 ** ((self.sensor.lightlevel - 1) / 10000)), 2)
|
return round(float(10 ** ((self.sensor.lightlevel - 1) / 10000)), 2)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = super().device_state_attributes
|
attributes = super().extra_state_attributes
|
||||||
attributes.update(
|
attributes.update(
|
||||||
{
|
{
|
||||||
"lightlevel": self.sensor.lightlevel,
|
"lightlevel": self.sensor.lightlevel,
|
||||||
|
|
|
@ -197,6 +197,6 @@ class GenericZLLSensor(GenericHueSensor):
|
||||||
"""Representation of a Hue-brand, physical sensor."""
|
"""Representation of a Hue-brand, physical sensor."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
return {"battery_level": self.sensor.battery}
|
return {"battery_level": self.sensor.battery}
|
||||||
|
|
|
@ -111,7 +111,7 @@ class PowerViewShade(ShadeEntity, CoverEntity):
|
||||||
self._current_cover_position = MIN_POSITION
|
self._current_cover_position = MIN_POSITION
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {STATE_ATTRIBUTE_ROOM_NAME: self._room_name}
|
return {STATE_ATTRIBUTE_ROOM_NAME: self._room_name}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ class PowerViewScene(HDEntity, Scene):
|
||||||
return self._scene.name
|
return self._scene.name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {STATE_ATTRIBUTE_ROOM_NAME: self._room_name}
|
return {STATE_ATTRIBUTE_ROOM_NAME: self._room_name}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ class HvvDepartureBinarySensor(CoordinatorEntity, BinarySensorEntity):
|
||||||
return DEVICE_CLASS_PROBLEM
|
return DEVICE_CLASS_PROBLEM
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
if not (
|
if not (
|
||||||
self.coordinator.last_update_success
|
self.coordinator.last_update_success
|
||||||
|
|
|
@ -199,6 +199,6 @@ class HVVDepartureSensor(Entity):
|
||||||
return DEVICE_CLASS_TIMESTAMP
|
return DEVICE_CLASS_TIMESTAMP
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return self.attr
|
return self.attr
|
||||||
|
|
|
@ -151,7 +151,7 @@ class HydrawiseEntity(Entity):
|
||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {ATTR_ATTRIBUTION: ATTRIBUTION, "identifier": self.data.get("relay")}
|
return {ATTR_ATTRIBUTION: ATTRIBUTION, "identifier": self.data.get("relay")}
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ class IcloudTrackerEntity(TrackerEntity):
|
||||||
return icon_for_icloud_device(self._device)
|
return icon_for_icloud_device(self._device)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, any]:
|
def extra_state_attributes(self) -> Dict[str, any]:
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
return self._device.state_attributes
|
return self._device.state_attributes
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ class IcloudDeviceBatterySensor(Entity):
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@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 default attributes for the iCloud device entity."""
|
||||||
return self._device.state_attributes
|
return self._device.state_attributes
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ class IgnSismologiaLocationEvent(GeolocationEvent):
|
||||||
return LENGTH_KILOMETERS
|
return LENGTH_KILOMETERS
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
for key, value in (
|
for key, value in (
|
||||||
|
|
|
@ -42,7 +42,7 @@ class IHCDevice(Entity):
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
if not self.info:
|
if not self.info:
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -171,7 +171,7 @@ class EmailContentSensor(Entity):
|
||||||
return self._message
|
return self._message
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return other state attributes for the message."""
|
"""Return other state attributes for the message."""
|
||||||
return self._state_attributes
|
return self._state_attributes
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,6 @@ class IncomfortFailed(IncomfortChild, BinarySensorEntity):
|
||||||
return self._heater.status["is_failed"]
|
return self._heater.status["is_failed"]
|
||||||
|
|
||||||
@property
|
@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 the device state attributes."""
|
||||||
return {"fault_code": self._heater.status["fault_code"]}
|
return {"fault_code": self._heater.status["fault_code"]}
|
||||||
|
|
|
@ -39,7 +39,7 @@ class InComfortClimate(IncomfortChild, ClimateEntity):
|
||||||
self._room = room
|
self._room = room
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self) -> Dict[str, Any]:
|
def extra_state_attributes(self) -> Dict[str, Any]:
|
||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
return {"status": self._room.status}
|
return {"status": self._room.status}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,6 @@ class IncomfortTemperature(IncomfortSensor):
|
||||||
self._unit_of_measurement = TEMP_CELSIUS
|
self._unit_of_measurement = TEMP_CELSIUS
|
||||||
|
|
||||||
@property
|
@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 the device state attributes."""
|
||||||
return {self._attr: self._heater.status[self._attr]}
|
return {self._attr: self._heater.status[self._attr]}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue