Update integrations a-e to override extra_state_attributes() (#47756)
parent
f92b75cbb2
commit
6c084ae6ce
homeassistant/components
accuweather
aftership
agent_dvr
airnow
airvisual
alarmdecoder
alpha_vantage
android_ip_webcam
androidtv
asuswrt
atome
aurora
automation
awair
azure_devops
bayesian
bbox
bitcoin
blockchain
bluesound
bmw_connected_drive
brother
brottsplatskartan
brunt
buienradar
caldav
cert_expiry
citybikes
co2signal
coinbase
comed_hourly_pricing
command_line
coronavirus
cpuspeed
cups
currencylayer
darksky
delijn
denonavr
derivative
deutsche_bahn
device_tracker
digital_ocean
directv
discogs
dlink
doods
dovado
dublin_bus_transport
dwd_weather_warnings
eafm
ebusd
ecobee
ecovacs
edl21
eight_sleep
elv
emoncms
enigma2
enphase_envoy
entur_public_transport
envisalink
epson
|
@ -363,7 +363,7 @@ class AbodeDevice(AbodeEntity):
|
|||
return self._device.name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
@ -411,7 +411,7 @@ class AbodeAutomation(AbodeEntity):
|
|||
return self._automation.name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION, "type": "CUE automation"}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class AbodeAlarm(AbodeDevice, alarm.AlarmControlPanelEntity):
|
|||
self._device.set_away()
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
|
|
@ -141,7 +141,7 @@ class AccuWeatherSensor(CoordinatorEntity):
|
|||
return SENSOR_TYPES[self.kind][self._unit_system]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self.forecast_day is not None:
|
||||
if self.kind in ["WindDay", "WindNight", "WindGustDay", "WindGustNight"]:
|
||||
|
|
|
@ -52,6 +52,6 @@ class AbstractAemetSensor(CoordinatorEntity):
|
|||
return self._unit_of_measurement
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
|
|
@ -134,7 +134,7 @@ class AfterShipSensor(Entity):
|
|||
return "packages"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return attributes for the sensor."""
|
||||
return self._attributes
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ class AgentCamera(MjpegCamera):
|
|||
self._removed = True
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the Agent DVR camera state attributes."""
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
|
|
@ -117,7 +117,7 @@ class AirlyAirQuality(CoordinatorEntity, AirQualityEntity):
|
|||
}
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
attrs = {
|
||||
LABEL_AQI_DESCRIPTION: self.coordinator.data[ATTR_API_CAQI_DESCRIPTION],
|
||||
|
|
|
@ -102,7 +102,7 @@ class AirlySensor(CoordinatorEntity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self._attrs
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ class AirNowSensor(CoordinatorEntity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self.kind == ATTR_API_AQI:
|
||||
self._attrs[SENSOR_AQI_ATTR_DESCR] = self.coordinator.data[
|
||||
|
|
|
@ -372,7 +372,7 @@ class AirVisualEntity(CoordinatorEntity):
|
|||
self._unit = None
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
return self._attrs
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ class AlarmDecoderAlarmPanel(AlarmControlPanelEntity):
|
|||
return self._code_arm_required
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {
|
||||
"ac_power": self._ac_power,
|
||||
|
|
|
@ -118,7 +118,7 @@ class AlarmDecoderBinarySensor(BinarySensorEntity):
|
|||
return False
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
attr = {CONF_ZONE_NUMBER: self._zone_number}
|
||||
if self._rfid and self._rfstate is not None:
|
||||
|
|
|
@ -133,7 +133,7 @@ class AlphaVantageSensor(Entity):
|
|||
return self.values["1. open"]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self.values is not None:
|
||||
return {
|
||||
|
@ -193,7 +193,7 @@ class AlphaVantageForeignExchange(Entity):
|
|||
return self._icon
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self.values is not None:
|
||||
return {
|
||||
|
|
|
@ -266,7 +266,7 @@ class AmcrestCam(Camera):
|
|||
return self._name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the Amcrest-specific camera state attributes."""
|
||||
attr = {}
|
||||
if self._audio_enabled is not None:
|
||||
|
|
|
@ -66,7 +66,7 @@ class AmcrestSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self._attrs
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ class AndroidIPCamEntity(Entity):
|
|||
return self._ipcam.available
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
state_attr = {ATTR_HOST: self._host}
|
||||
if self._ipcam.status_data is None:
|
||||
|
|
|
@ -469,7 +469,7 @@ class ADBDevice(MediaPlayerEntity):
|
|||
return self._available
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Provide the last ADB command's response and the device's HDMI input as attributes."""
|
||||
return {
|
||||
"adb_response": self._adb_response,
|
||||
|
|
|
@ -136,7 +136,7 @@ class ArloBaseStation(AlarmControlPanelEntity):
|
|||
return self._base_station.name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
|
|
@ -108,7 +108,7 @@ class ArloCam(Camera):
|
|||
return self._name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {
|
||||
name: value
|
||||
|
|
|
@ -183,7 +183,7 @@ class ArloSensor(Entity):
|
|||
self._state = None
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
attrs = {}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ class AsusWrtDevice(ScannerEntity):
|
|||
return self._icon
|
||||
|
||||
@property
|
||||
def device_state_attributes(self) -> Dict[str, any]:
|
||||
def extra_state_attributes(self) -> Dict[str, any]:
|
||||
"""Return the attributes."""
|
||||
return self._attrs
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ class AsusWrtSensor(CoordinatorEntity):
|
|||
return self._device_class
|
||||
|
||||
@property
|
||||
def device_state_attributes(self) -> Dict[str, any]:
|
||||
def extra_state_attributes(self) -> Dict[str, any]:
|
||||
"""Return the attributes."""
|
||||
return {"hostname": self._router.host}
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ class AtomeSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self._attributes
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ class AugustLock(AugustEntityMixin, RestoreEntity, LockEntity):
|
|||
return self._changed_by
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device specific state attributes."""
|
||||
attributes = {ATTR_BATTERY_LEVEL: self._detail.battery_level}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ class AugustOperatorSensor(AugustEntityMixin, RestoreEntity, Entity):
|
|||
self._entity_picture = lock_activity.operator_thumbnail_url
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device specific state attributes."""
|
||||
attributes = {}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ class AuroraEntity(CoordinatorEntity):
|
|||
return self._name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {"attribution": ATTRIBUTION}
|
||||
|
||||
|
|
|
@ -535,7 +535,7 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
|
|||
)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return automation attributes."""
|
||||
if self._id is None:
|
||||
return None
|
||||
|
|
|
@ -179,7 +179,7 @@ class AwairSensor(CoordinatorEntity):
|
|||
return SENSOR_TYPES[self._kind][ATTR_UNIT]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self) -> dict:
|
||||
def extra_state_attributes(self) -> dict:
|
||||
"""Return the Awair Index alongside state attributes.
|
||||
|
||||
The Awair Index is a subjective score ranging from 0-4 (inclusive) that
|
||||
|
|
|
@ -92,7 +92,7 @@ class AzureDevOpsSensor(AzureDevOpsDeviceEntity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self) -> object:
|
||||
def extra_state_attributes(self) -> object:
|
||||
"""Return the attributes of the sensor."""
|
||||
return self._attributes
|
||||
|
||||
|
|
|
@ -384,7 +384,7 @@ class BayesianBinarySensor(BinarySensorEntity):
|
|||
return self._device_class
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
|
||||
attr_observations_list = [
|
||||
|
|
|
@ -115,7 +115,7 @@ class BboxUptimeSensor(Entity):
|
|||
return self._icon
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
@ -167,7 +167,7 @@ class BboxSensor(Entity):
|
|||
return self._icon
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ class BitcoinSensor(Entity):
|
|||
return ICON
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ class BlinkSyncModule(AlarmControlPanelEntity):
|
|||
return f"{DOMAIN} {self._name}"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
attr = self.sync.attributes
|
||||
attr["network_info"] = self.data.networks
|
||||
|
|
|
@ -60,7 +60,7 @@ class BlinkCamera(Camera):
|
|||
return self._unique_id
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the camera attributes."""
|
||||
return self._camera.attributes
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class BlockchainSensor(Entity):
|
|||
return ICON
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
|
|
@ -850,7 +850,7 @@ class BluesoundPlayer(MediaPlayerEntity):
|
|||
_LOGGER.error("Master not found %s", master_device)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""List members in group."""
|
||||
attributes = {}
|
||||
if self._group_list:
|
||||
|
|
|
@ -334,7 +334,7 @@ class BMWConnectedDriveBaseEntity(Entity):
|
|||
}
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
return self._attrs
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ class BMWConnectedDriveSensor(BMWConnectedDriveBaseEntity, BinarySensorEntity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the binary sensor."""
|
||||
vehicle_state = self._vehicle.state
|
||||
result = self._attrs.copy()
|
||||
|
|
|
@ -52,7 +52,7 @@ class BMWLock(BMWConnectedDriveBaseEntity, LockEntity):
|
|||
return self._name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the lock."""
|
||||
vehicle_state = self._vehicle.state
|
||||
result = self._attrs.copy()
|
||||
|
|
|
@ -88,7 +88,7 @@ class BrotherPrinterSensor(CoordinatorEntity):
|
|||
return None
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
remaining_pages = None
|
||||
drum_counter = None
|
||||
|
|
|
@ -99,7 +99,7 @@ class BrottsplatskartanSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self._attributes
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ class BruntDevice(CoverEntity):
|
|||
return self.move_state == 2
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the detailed device state attributes."""
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
|
|
@ -430,7 +430,7 @@ class BrSensor(Entity):
|
|||
return self._entity_picture
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self.type.startswith(PRECIPITATION_FORECAST):
|
||||
result = {ATTR_ATTRIBUTION: self._attribution}
|
||||
|
|
|
@ -123,7 +123,7 @@ class WebDavCalendarEventDevice(CalendarEventDevice):
|
|||
self._offset_reached = False
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
return {"offset_reached": self._offset_reached}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ class CanaryAlarm(CoordinatorEntity, AlarmControlPanelEntity):
|
|||
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {"private": self.location.is_private}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ class CanarySensor(CoordinatorEntity, Entity):
|
|||
return self._sensor_type[2]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
reading = self.reading
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class CertExpiryEntity(CoordinatorEntity):
|
|||
return "mdi:certificate"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return additional sensor state attributes."""
|
||||
return {
|
||||
"is_valid": self.coordinator.is_cert_valid,
|
||||
|
|
|
@ -286,7 +286,7 @@ class CityBikesStation(Entity):
|
|||
break
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self._station_data:
|
||||
return {
|
||||
|
|
|
@ -91,7 +91,7 @@ class CO2Sensor(Entity):
|
|||
return CO2_INTENSITY_UNIT
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the last update."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ class AccountSensor(Entity):
|
|||
return CURRENCY_ICONS.get(self._unit_of_measurement, DEFAULT_COIN_ICON)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
@ -120,7 +120,7 @@ class ExchangeRateSensor(Entity):
|
|||
return CURRENCY_ICONS.get(self.currency, DEFAULT_COIN_ICON)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ class ComedHourlyPricingSensor(Entity):
|
|||
return self._unit_of_measurement
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ class CommandSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self._attributes
|
||||
|
||||
|
|
|
@ -73,6 +73,6 @@ class CoronavirusSensor(CoordinatorEntity):
|
|||
return "people"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device attributes."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
|
|
@ -54,7 +54,7 @@ class CpuSpeedSensor(Entity):
|
|||
return FREQUENCY_GIGAHERTZ
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self.info is not None:
|
||||
attrs = {
|
||||
|
|
|
@ -131,7 +131,7 @@ class CupsSensor(Entity):
|
|||
return ICON_PRINTER
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
if self._printer is None:
|
||||
return None
|
||||
|
@ -193,7 +193,7 @@ class IPPSensor(Entity):
|
|||
return PRINTER_STATES.get(key, key)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
if self._attributes is None:
|
||||
return None
|
||||
|
@ -271,7 +271,7 @@ class MarkerSensor(Entity):
|
|||
return PERCENTAGE
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
if self._attributes is None:
|
||||
return None
|
||||
|
|
|
@ -86,7 +86,7 @@ class CurrencylayerSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
|
|
@ -620,7 +620,7 @@ class DarkSkySensor(Entity):
|
|||
return None
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
|
@ -739,7 +739,7 @@ class DarkSkyAlertSensor(Entity):
|
|||
return "mdi:alert-circle-outline"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self._alerts
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ class DeconzBinarySensor(DeconzDevice, BinarySensorEntity):
|
|||
return DEVICE_CLASS.get(type(self._device))
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
attr = {}
|
||||
|
||||
|
|
|
@ -244,7 +244,7 @@ class DeconzThermostat(DeconzDevice, ClimateEntity):
|
|||
return TEMP_CELSIUS
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the thermostat."""
|
||||
attr = {}
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ class DeconzBaseLight(DeconzDevice, LightEntity):
|
|||
await self._device.async_set_state(data)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
return {"is_deconz_group": self._device.type == "LightGroup"}
|
||||
|
||||
|
@ -275,9 +275,9 @@ class DeconzGroup(DeconzBaseLight):
|
|||
}
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
attributes = dict(super().device_state_attributes)
|
||||
attributes = dict(super().extra_state_attributes)
|
||||
attributes["all_on"] = self._device.all_on
|
||||
|
||||
return attributes
|
||||
|
|
|
@ -155,7 +155,7 @@ class DeconzSensor(DeconzDevice):
|
|||
return UNIT_OF_MEASUREMENT.get(type(self._device))
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
attr = {}
|
||||
|
||||
|
@ -235,7 +235,7 @@ class DeconzBattery(DeconzDevice):
|
|||
return PERCENTAGE
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the battery."""
|
||||
attr = {}
|
||||
|
||||
|
|
|
@ -126,6 +126,6 @@ class DeLijnPublicTransportSensor(Entity):
|
|||
return "mdi:bus"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return attributes for the sensor."""
|
||||
return self._attributes
|
||||
|
|
|
@ -49,7 +49,7 @@ class DemoRemote(RemoteEntity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device state attributes."""
|
||||
if self._last_command_sent is not None:
|
||||
return {"last_command_sent": self._last_command_sent}
|
||||
|
|
|
@ -96,7 +96,7 @@ class DemoSensor(Entity):
|
|||
return self._unit_of_measurement
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self._battery:
|
||||
return {ATTR_BATTERY_LEVEL: self._battery}
|
||||
|
|
|
@ -140,7 +140,7 @@ class DemoVacuum(VacuumEntity):
|
|||
return max(0, min(100, self._battery_level))
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device state attributes."""
|
||||
return {ATTR_CLEANED_AREA: round(self._cleaned_area, 2)}
|
||||
|
||||
|
@ -288,7 +288,7 @@ class StateDemoVacuum(StateVacuumEntity):
|
|||
return FAN_SPEEDS
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device state attributes."""
|
||||
return {ATTR_CLEANED_AREA: round(self._cleaned_area, 2)}
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ class DenonDevice(MediaPlayerEntity):
|
|||
return None
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
if (
|
||||
self._sound_mode_raw is not None
|
||||
|
|
|
@ -211,7 +211,7 @@ class DerivativeSensor(RestoreEntity):
|
|||
return False
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the sensor."""
|
||||
return {ATTR_SOURCE_ID: self._sensor_source_id}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class DeutscheBahnSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
connections = self.data.connections[0]
|
||||
if len(self.data.connections) > 1:
|
||||
|
|
|
@ -675,7 +675,7 @@ class Device(RestoreEntity):
|
|||
return attributes
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device state attributes."""
|
||||
return self._attributes
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class DigitalOceanBinarySensor(BinarySensorEntity):
|
|||
return DEVICE_CLASS_MOVING
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the Digital Ocean droplet."""
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
|
|
@ -71,7 +71,7 @@ class DigitalOceanSwitch(SwitchEntity):
|
|||
return self.data.status == "active"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the Digital Ocean droplet."""
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
|
|
@ -124,7 +124,7 @@ class DIRECTVMediaPlayer(DIRECTVEntity, MediaPlayerEntity):
|
|||
self._assumed_state = self._is_recorded
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
if self._is_standby:
|
||||
return {}
|
||||
|
|
|
@ -121,7 +121,7 @@ class DiscogsSensor(Entity):
|
|||
return SENSORS[self._type]["unit_of_measurement"]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device state attributes of the sensor."""
|
||||
if self._state is None or self._attrs is None:
|
||||
return None
|
||||
|
|
|
@ -71,7 +71,7 @@ class SmartPlugSwitch(SwitchEntity):
|
|||
return self._name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the device."""
|
||||
try:
|
||||
ui_temp = self.units.temperature(int(self.data.temperature), TEMP_CELSIUS)
|
||||
|
|
|
@ -221,7 +221,7 @@ class Doods(ImageProcessingEntity):
|
|||
return self._total_matches
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
return {
|
||||
ATTR_MATCHES: self._matches,
|
||||
|
|
|
@ -105,6 +105,6 @@ class DovadoSensor(Entity):
|
|||
return SENSORS[self._sensor][2]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {k: v for k, v in self._data.state.items() if k not in ["date", "time"]}
|
||||
|
|
|
@ -87,7 +87,7 @@ class DublinPublicTransportSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self._times is not None:
|
||||
next_up = "None"
|
||||
|
|
|
@ -119,7 +119,7 @@ class DwdWeatherWarningsSensor(Entity):
|
|||
return self._api.api.expected_warning_level
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the DWD-Weather-Warnings."""
|
||||
data = {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
|
|
|
@ -88,6 +88,6 @@ class DysonAirSensor(DysonEntity, AirQualityEntity):
|
|||
return int(self._device.environmental_state.volatile_organic_compounds)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
return {ATTR_VOC: self.volatile_organic_compounds}
|
||||
|
|
|
@ -200,7 +200,7 @@ class DysonFanEntity(DysonEntity, FanEntity):
|
|||
return SUPPORT_OSCILLATE | SUPPORT_SET_SPEED
|
||||
|
||||
@property
|
||||
def device_state_attributes(self) -> dict:
|
||||
def extra_state_attributes(self) -> dict:
|
||||
"""Return optional state attributes."""
|
||||
return {
|
||||
ATTR_NIGHT_MODE: self.night_mode,
|
||||
|
@ -455,10 +455,10 @@ class DysonPureCoolEntity(DysonFanEntity):
|
|||
return int(self._device.state.carbon_filter_state)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self) -> dict:
|
||||
def extra_state_attributes(self) -> dict:
|
||||
"""Return optional state attributes."""
|
||||
return {
|
||||
**super().device_state_attributes,
|
||||
**super().extra_state_attributes,
|
||||
ATTR_ANGLE_LOW: self.angle_low,
|
||||
ATTR_ANGLE_HIGH: self.angle_high,
|
||||
ATTR_FLOW_DIRECTION_FRONT: self.flow_direction_front,
|
||||
|
|
|
@ -95,7 +95,7 @@ class Dyson360EyeDevice(DysonEntity, VacuumEntity):
|
|||
return ["Quiet", "Max"]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the specific state attributes of this vacuum cleaner."""
|
||||
return {ATTR_POSITION: str(self._device.state.position)}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ class Measurement(CoordinatorEntity):
|
|||
return UNIT_MAPPING.get(measure["unit"], measure["unitName"])
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the sensor specific state attributes."""
|
||||
return {ATTR_ATTRIBUTION: self.attribution}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class EbusdSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
if self._type == 1 and self._state is not None:
|
||||
schedule = {
|
||||
|
|
|
@ -519,7 +519,7 @@ class Thermostat(ClimateEntity):
|
|||
return CURRENT_HVAC_IDLE
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
status = self.thermostat["equipmentStatus"]
|
||||
return {
|
||||
|
|
|
@ -189,7 +189,7 @@ class EcovacsVacuum(VacuumEntity):
|
|||
self.device.run(sucks.VacBotCommand(command, params))
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device-specific state attributes of this vacuum."""
|
||||
data = {}
|
||||
data[ATTR_ERROR] = self._error
|
||||
|
|
|
@ -269,7 +269,7 @@ class EDL21Entity(Entity):
|
|||
return self._telegram.get("value")
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Enumerate supported attributes."""
|
||||
return {
|
||||
self._state_attrs[k]: v
|
||||
|
|
|
@ -110,7 +110,7 @@ class EightHeatSensor(EightSleepHeatEntity):
|
|||
self._state = self._usrobj.heating_level
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device state attributes."""
|
||||
return {
|
||||
ATTR_TARGET_HEAT: self._usrobj.target_heating_level,
|
||||
|
@ -202,7 +202,7 @@ class EightUserSensor(EightSleepUserEntity):
|
|||
self._state = self._usrobj.current_values["stage"]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device state attributes."""
|
||||
if self._attr is None:
|
||||
# Skip attributes if sensor type doesn't support
|
||||
|
|
|
@ -429,7 +429,7 @@ class ElkEntity(Entity):
|
|||
return False
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the default attributes of the element."""
|
||||
return {**self._element.as_dict(), **self.initial_attrs()}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ class ElkArea(ElkAttachedEntity, AlarmControlPanelEntity, RestoreEntity):
|
|||
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Attributes of the area."""
|
||||
attrs = self.initial_attrs()
|
||||
elmt = self._element
|
||||
|
|
|
@ -136,7 +136,7 @@ class ElkKeypad(ElkSensor):
|
|||
return "mdi:thermometer-lines"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Attributes of the sensor."""
|
||||
attrs = self.initial_attrs()
|
||||
attrs["area"] = self._element.area + 1
|
||||
|
@ -163,7 +163,7 @@ class ElkPanel(ElkSensor):
|
|||
return "mdi:home"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Attributes of the sensor."""
|
||||
attrs = self.initial_attrs()
|
||||
attrs["system_trouble_status"] = self._element.system_trouble_status
|
||||
|
@ -190,7 +190,7 @@ class ElkSetting(ElkSensor):
|
|||
self._state = self._element.value
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Attributes of the sensor."""
|
||||
attrs = self.initial_attrs()
|
||||
attrs["value_format"] = SettingFormat(self._element.value_format).name.lower()
|
||||
|
@ -227,7 +227,7 @@ class ElkZone(ElkSensor):
|
|||
return f"mdi:{zone_icons.get(self._element.definition, 'alarm-bell')}"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Attributes of the sensor."""
|
||||
attrs = self.initial_attrs()
|
||||
attrs["physical_status"] = ZonePhysicalStatus(
|
||||
|
|
|
@ -74,7 +74,7 @@ class SmartPlugSwitch(SwitchEntity):
|
|||
self._pca.turn_off(self._device_id)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the device."""
|
||||
return self._emeter_params
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ class EmonCmsSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the attributes of the sensor."""
|
||||
return {
|
||||
ATTR_FEEDID: self._elem["id"],
|
||||
|
|
|
@ -251,7 +251,7 @@ class Enigma2Device(MediaPlayerEntity):
|
|||
self.e2_box.update()
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device specific state attributes.
|
||||
|
||||
isRecording: Is the box currently recording.
|
||||
|
|
|
@ -202,7 +202,7 @@ class Envoy(CoordinatorEntity):
|
|||
return ICON
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if (
|
||||
self._type == "inverters"
|
||||
|
|
|
@ -172,7 +172,7 @@ class EnturPublicTransportSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self) -> dict:
|
||||
def extra_state_attributes(self) -> dict:
|
||||
"""Return the state attributes."""
|
||||
self._attributes[ATTR_ATTRIBUTION] = ATTRIBUTION
|
||||
self._attributes[ATTR_STOP_ID] = self._stop
|
||||
|
|
|
@ -81,7 +81,7 @@ class ECCamera(Camera):
|
|||
return "Environment Canada Radar"
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the device."""
|
||||
return {ATTR_ATTRIBUTION: CONF_ATTRIBUTION, ATTR_UPDATED: self.timestamp}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ class ECSensor(Entity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes of the device."""
|
||||
return self._attr
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class EnvisalinkBinarySensor(EnvisalinkDevice, BinarySensorEntity):
|
|||
async_dispatcher_connect(self.hass, SIGNAL_ZONE_UPDATE, self._update_callback)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
attr = {}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ class EnvisalinkSensor(EnvisalinkDevice, Entity):
|
|||
return self._info["status"]["alpha"]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self._info["status"]
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ class EpsonProjectorMediaPlayer(MediaPlayerEntity):
|
|||
await self._projector.send_command(BACK)
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
def extra_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
if self._cmode is None:
|
||||
return {}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue