From abb36ff45f46a5ca20af6393b127063f888c0a66 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sun, 19 Dec 2021 13:27:23 +0100 Subject: [PATCH] Use _attr_attribution in sense (#62181) Co-authored-by: epenet --- homeassistant/components/sense/sensor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/sense/sensor.py b/homeassistant/components/sense/sensor.py index b5fdb4398c0..9a2c968741e 100644 --- a/homeassistant/components/sense/sensor.py +++ b/homeassistant/components/sense/sensor.py @@ -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