From 458ea10a0cd84effc2afaa1d64bf34d7e7b33402 Mon Sep 17 00:00:00 2001 From: Johan Isacsson Date: Tue, 7 Sep 2021 14:46:31 +0200 Subject: [PATCH] Fixed another eddi ct issue --- custom_components/myenergi/const.py | 2 +- custom_components/myenergi/manifest.json | 2 +- custom_components/myenergi/sensor.py | 24 +++++++++++++----------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/custom_components/myenergi/const.py b/custom_components/myenergi/const.py index c633916..9cd66c4 100644 --- a/custom_components/myenergi/const.py +++ b/custom_components/myenergi/const.py @@ -3,7 +3,7 @@ NAME = "myenergi" DOMAIN = "myenergi" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "0.0.9" +VERSION = "0.0.10" ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/" ISSUE_URL = "https://github.com/cjne/myenergi/issues" diff --git a/custom_components/myenergi/manifest.json b/custom_components/myenergi/manifest.json index 2f8b3cf..7c24f69 100644 --- a/custom_components/myenergi/manifest.json +++ b/custom_components/myenergi/manifest.json @@ -1,7 +1,7 @@ { "domain": "myenergi", "name": "myenergi", - "version": "0.0.9", + "version": "0.0.10", "documentation": "https://github.com/cjne/ha-myenergi", "issue_tracker": "https://github.com/cjne/ha-myenergi/issues", "dependencies": [], diff --git a/custom_components/myenergi/sensor.py b/custom_components/myenergi/sensor.py index f7cb985..34b5b11 100644 --- a/custom_components/myenergi/sensor.py +++ b/custom_components/myenergi/sensor.py @@ -185,17 +185,6 @@ async def async_setup_entry(hass, entry, async_add_devices): ), ) ) - sensors.append( - MyenergiSensor( - coordinator, - device, - entry, - create_power_meta( - f"{device.ct3.name} CT3", - "ct3.power", - ), - ) - ) # Sensors common to Zapi and Eddi if device.kind in ["zappi", "eddi"]: @@ -222,6 +211,19 @@ async def async_setup_entry(hass, entry, async_add_devices): ) for key in device.ct_keys: sensors.append(MyenergiCTEnergySensor(coordinator, device, entry, key)) + # Zappi and harvi + if device.kind in ["zappi", "harvi"]: + sensors.append( + MyenergiSensor( + coordinator, + device, + entry, + create_power_meta( + f"{device.ct3.name} CT3", + "ct3.power", + ), + ) + ) # Zappi only sensors if device.kind == "zappi": sensors.append(