diff --git a/custom_components/daikin_onecta/const.py b/custom_components/daikin_onecta/const.py index eaa7aa5..3cc48f3 100644 --- a/custom_components/daikin_onecta/const.py +++ b/custom_components/daikin_onecta/const.py @@ -42,7 +42,6 @@ ENABLED_DEFAULT = "Enabled" STATE_CLASS = "STATE" ENTITY_CATEGORY = "ENTITY_CATEGORY" -CONF_NATIVE_UNIT_OF_MEASUREMENT = "native_unit_of_measurement" # This maps the NAME as listed in the Daikin JSON data to: # - DEVICE_CLASS: home assistant device class, see @@ -55,7 +54,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:alphabetical", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -64,7 +62,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:toggle-switch-variant", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -73,7 +70,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:alphabetical", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -82,7 +78,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:alphabetical", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -91,7 +86,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:alphabetical", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -100,7 +94,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:alphabetical", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -109,7 +102,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:numeric", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -118,7 +110,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:access-point-network", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -127,7 +118,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.SIGNAL_STRENGTH, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: SIGNAL_STRENGTH_DECIBELS_MILLIWATT, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:wifi", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -136,7 +126,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:access-point-network", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -145,7 +134,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -154,7 +142,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -163,7 +150,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -172,7 +158,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -181,7 +166,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -190,7 +174,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -199,7 +182,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -208,7 +190,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -217,7 +198,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -226,7 +206,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -235,7 +214,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -244,7 +222,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -253,7 +230,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -262,7 +238,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -271,7 +246,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -280,7 +254,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -289,7 +262,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -298,7 +270,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -307,7 +278,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, - CONF_NATIVE_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, CONF_ICON: "", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -316,7 +286,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, - CONF_NATIVE_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, CONF_ICON: "", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -325,7 +294,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, - CONF_NATIVE_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, CONF_ICON: "", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -334,7 +302,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, - CONF_NATIVE_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, CONF_ICON: "mdi:bathtub-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -343,7 +310,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, - CONF_NATIVE_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, CONF_ICON: "", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -352,7 +318,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, - CONF_NATIVE_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, CONF_ICON: "", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -361,7 +326,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, - CONF_NATIVE_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS, CONF_ICON: "", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -370,7 +334,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:water-percent", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -379,7 +342,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "hass:air-filter", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -388,7 +350,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:rocket-launch", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -397,7 +358,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:leaf", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -406,7 +366,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: REVOLUTIONS_PER_MINUTE, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:fan", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -415,7 +374,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -424,7 +382,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -433,7 +390,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -442,7 +398,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -451,7 +406,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -460,7 +414,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -469,7 +422,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -478,7 +430,6 @@ CONF_DEVICE_CLASS: None, CONF_STATE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:information-outline", ENABLED_DEFAULT: True, ENTITY_CATEGORY: EntityCategory.DIAGNOSTIC, @@ -487,7 +438,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.HUMIDITY, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: PERCENTAGE, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:water-percent", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -496,7 +446,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.PM1, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:blur", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -505,7 +454,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.PM25, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:blur", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, @@ -514,7 +462,6 @@ CONF_DEVICE_CLASS: SensorDeviceClass.PM10, CONF_STATE_CLASS: SensorStateClass.MEASUREMENT, CONF_UNIT_OF_MEASUREMENT: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, - CONF_NATIVE_UNIT_OF_MEASUREMENT: None, CONF_ICON: "mdi:blur", ENABLED_DEFAULT: True, ENTITY_CATEGORY: None, diff --git a/custom_components/daikin_onecta/sensor.py b/custom_components/daikin_onecta/sensor.py index 910dd72..461395b 100644 --- a/custom_components/daikin_onecta/sensor.py +++ b/custom_components/daikin_onecta/sensor.py @@ -22,7 +22,6 @@ from .const import SENSOR_PERIOD_WEEKLY from .const import SENSOR_PERIODS from .const import VALUE_SENSOR_MAPPING -from .const import CONF_NATIVE_UNIT_OF_MEASUREMENT from .daikin_base import Appliance _LOGGER = logging.getLogger(__name__) @@ -172,7 +171,10 @@ def __init__( self._attr_entity_category = None self._attr_icon = icon self._attr_has_entity_name = True - self._state = self.sensor_value() + self._attr_device_class = SensorDeviceClass.ENERGY + self._attr_state_class = SensorStateClass.TOTAL_INCREASING + self._attr_native_unit_of_measurement = UnitOfEnergy.KILO_WATT_HOUR + self._attr_native_value = self.sensor_value() _LOGGER.info( "Device '%s:%s' supports sensor '%s'", device.name, @@ -180,14 +182,9 @@ def __init__( self._attr_name, ) - @property - def state(self): - """Return the state of the sensor.""" - return self._state - @callback def _handle_coordinator_update(self) -> None: - self._state = self.sensor_value() + self._attr_native_value = self.sensor_value() self.async_write_ha_state() def sensor_value(self): @@ -230,18 +227,6 @@ def device_info(self): """Return a device description for device registry.""" return self._device.device_info() - @property - def unit_of_measurement(self): - return UnitOfEnergy.KILO_WATT_HOUR - - @property - def state_class(self): - return SensorStateClass.TOTAL_INCREASING - - @property - def device_class(self): - return SensorDeviceClass.ENERGY - class DaikinValueSensor(CoordinatorEntity, SensorEntity): @@ -261,7 +246,6 @@ def __init__( self._management_point_type = management_point_type self._sub_type = sub_type self._value = value - self._unit_of_measurement = None self._attr_device_class = None self._attr_state_class = None self._attr_has_entity_name = True @@ -275,11 +259,10 @@ def __init__( else: self._attr_icon = sensor_settings[CONF_ICON] self._attr_device_class = sensor_settings[CONF_DEVICE_CLASS] - self._unit_of_measurement = sensor_settings[CONF_UNIT_OF_MEASUREMENT] self._attr_entity_registry_enabled_default = sensor_settings[ENABLED_DEFAULT] self._attr_state_class = sensor_settings[CONF_STATE_CLASS] self._attr_entity_category = sensor_settings[ENTITY_CATEGORY] - self._attr_native_unit_of_measurement = sensor_settings[CONF_NATIVE_UNIT_OF_MEASUREMENT] + self._attr_native_unit_of_measurement = sensor_settings[CONF_UNIT_OF_MEASUREMENT] mpt = management_point_type[0].upper() + management_point_type[1:] myname = value[0].upper() + value[1:] readable = re.findall("[A-Z][^A-Z]*", myname) @@ -316,10 +299,6 @@ def available(self): """Return the availability of the underlying device.""" return self._device.available - @property - def unit_of_measurement(self): - return self._unit_of_measurement - @property def device_info(self): """Return a device description for device registry."""