From b46e5e83877e1fe1fb8ab69882bb42314ae2e9ec Mon Sep 17 00:00:00 2001 From: Johan Isacsson Date: Sun, 26 Mar 2023 16:26:40 +0200 Subject: [PATCH] Added PWM sensor to Zappi, fixes #302 --- custom_components/myenergi/sensor.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/custom_components/myenergi/sensor.py b/custom_components/myenergi/sensor.py index 56989bd..e2c84ff 100644 --- a/custom_components/myenergi/sensor.py +++ b/custom_components/myenergi/sensor.py @@ -11,6 +11,7 @@ from homeassistant.const import ELECTRIC_POTENTIAL_VOLT from homeassistant.const import ENERGY_KILO_WATT_HOUR from homeassistant.const import FREQUENCY_HERTZ +from homeassistant.const import PERCENTAGE from homeassistant.const import POWER_WATT from homeassistant.const import TEMP_CELSIUS from homeassistant.helpers.entity import EntityCategory @@ -351,6 +352,14 @@ async def async_setup_entry(hass, entry, async_add_devices): ) # Zappi only sensors if device.kind == ZAPPI: + sensors.append( + MyenergiSensor( + coordinator, + device, + entry, + create_meta("PWM", "pwm", unit=PERCENTAGE), + ) + ) sensors.append( MyenergiSensor( coordinator,