From 30c457a0c65ab6ff479d24f97bb8f8ff46e72305 Mon Sep 17 00:00:00 2001 From: dgtal1 <27864579+dgtal1@users.noreply.github.com> Date: Thu, 6 Oct 2022 20:32:02 +0200 Subject: [PATCH] 2.2b4 * fix power factor sensor value scaling * remove power factor sensor measurement unit --- extalife/manifest.json | 2 +- extalife/sensor.py | 29 +---------------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/extalife/manifest.json b/extalife/manifest.json index 95dafa7..c9d4f48 100644 --- a/extalife/manifest.json +++ b/extalife/manifest.json @@ -1,7 +1,7 @@ { "domain": "extalife", "name": "Exta Life", - "version": "2.2b3", + "version": "2.2b4", "config_flow": true, "documentation": "https://www.forumextalife.pl/index.php/board,56.0.html", "requirements": [ diff --git a/extalife/sensor.py b/extalife/sensor.py index 9b0bc50..5155030 100644 --- a/extalife/sensor.py +++ b/extalife/sensor.py @@ -166,10 +166,9 @@ class ExtaSensorDeviceClass(StrEnum): factor=0.01, ), SensorDeviceClass.POWER_FACTOR: ELSensorEntityDescription( - native_unit_of_measurement=PERCENTAGE, device_class=SensorDeviceClass.POWER_FACTOR, state_class=SensorStateClass.MEASUREMENT, - factor=0.01, + factor=0.001, ), SensorDeviceClass.CURRENT: ELSensorEntityDescription( native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, @@ -221,32 +220,6 @@ class ExtaSensorDeviceClass(StrEnum): ), } -# List of additional sensors which are created based on a property -# The key is the property name -VIRTUAL_SENSOR_TYPES: dict[str, ELSensorEntityDescription] = { - SensorDeviceClass.ENERGY: ELSensorEntityDescription( - key="energy", - native_unit_of_measurement=ENERGY_KILO_WATT_HOUR, - device_class=SensorDeviceClass.ENERGY, - state_class=SensorStateClass.TOTAL_INCREASING, - ) -}, { - SensorDeviceClass.POWER: ELSensorEntityDescription( - key="power", - native_unit_of_measurement=POWER_WATT, - device_class=SensorDeviceClass.POWER, - state_class=SensorStateClass.MEASUREMENT, - ), - SensorDeviceClass.BATTERY: ELSensorEntityDescription( - key="battery_status", - native_unit_of_measurement=PERCENTAGE, - device_class=SensorDeviceClass.BATTERY, - state_class=SensorStateClass.MEASUREMENT, - value_path="", - factor=100, - ), -} - async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """setup via configuration.yaml not supported anymore"""