mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Use _attr_attribution in sense (#62181)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
8bca984d61
commit
abb36ff45f
@ -5,7 +5,6 @@ from homeassistant.components.sensor import (
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION,
|
||||
ELECTRIC_POTENTIAL_VOLT,
|
||||
ENERGY_KILO_WATT_HOUR,
|
||||
PERCENTAGE,
|
||||
@ -152,7 +151,7 @@ class SenseActiveSensor(SensorEntity):
|
||||
|
||||
_attr_icon = ICON
|
||||
_attr_native_unit_of_measurement = POWER_WATT
|
||||
_attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
_attr_attribution = ATTRIBUTION
|
||||
_attr_should_poll = False
|
||||
_attr_available = False
|
||||
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||
@ -205,7 +204,7 @@ class SenseVoltageSensor(SensorEntity):
|
||||
"""Implementation of a Sense energy voltage sensor."""
|
||||
|
||||
_attr_native_unit_of_measurement = ELECTRIC_POTENTIAL_VOLT
|
||||
_attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
_attr_attribution = ATTRIBUTION
|
||||
_attr_icon = ICON
|
||||
_attr_should_poll = False
|
||||
_attr_available = False
|
||||
@ -251,7 +250,7 @@ class SenseTrendsSensor(CoordinatorEntity, SensorEntity):
|
||||
_attr_device_class = SensorDeviceClass.ENERGY
|
||||
_attr_state_class = SensorStateClass.TOTAL
|
||||
_attr_native_unit_of_measurement = ENERGY_KILO_WATT_HOUR
|
||||
_attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
_attr_attribution = ATTRIBUTION
|
||||
_attr_icon = ICON
|
||||
_attr_should_poll = False
|
||||
|
||||
@ -299,7 +298,7 @@ class SenseEnergyDevice(SensorEntity):
|
||||
_attr_available = False
|
||||
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||
_attr_native_unit_of_measurement = POWER_WATT
|
||||
_attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
_attr_attribution = ATTRIBUTION
|
||||
_attr_device_class = SensorDeviceClass.POWER
|
||||
_attr_should_poll = False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user