Skip to content

Commit

Permalink
2.2b4
Browse files Browse the repository at this point in the history
* fix power factor sensor value scaling
* remove power factor sensor measurement unit
  • Loading branch information
dgtal1 committed Oct 6, 2022
1 parent fa56c26 commit 30c457a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
2 changes: 1 addition & 1 deletion extalife/manifest.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
29 changes: 1 addition & 28 deletions extalife/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"""
Expand Down

0 comments on commit 30c457a

Please sign in to comment.