Skip to content

Commit

Permalink
Merge pull request #396 from jmccrohan/main
Browse files Browse the repository at this point in the history
Sensor fixes
  • Loading branch information
CJNE authored Sep 12, 2023
2 parents 5d1c394 + 65e2f33 commit 294eb3e
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions custom_components/myenergi/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,6 @@ async def async_setup_entry(hass, entry, async_add_devices):

# Sensors common to Zapi and Eddi
if device.kind in [ZAPPI, EDDI]:
sensors.append(
MyenergiSensor(
coordinator,
device,
entry,
create_meta("Status", "status", None, None, None, "mdi:ev-station"),
)
)
sensors.append(
MyenergiSensor(
coordinator,
Expand Down Expand Up @@ -352,6 +344,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("Status", "status", None, None, None, "mdi:ev-station"),
)
)
sensors.append(
MyenergiSensor(
coordinator,
Expand Down Expand Up @@ -425,6 +425,14 @@ async def async_setup_entry(hass, entry, async_add_devices):
)
elif device.kind == EDDI:
# Eddi specifc sensors
sensors.append(
MyenergiSensor(
coordinator,
device,
entry,
create_meta("Status", "status", None, None, None, "mdi:shower"),
)
)
sensors.append(
MyenergiSensor(
coordinator,
Expand All @@ -433,6 +441,20 @@ async def async_setup_entry(hass, entry, async_add_devices):
create_energy_meta("Energy consumed session", "consumed_session"),
)
)
sensors.append(
MyenergiSensor(
coordinator,
device,
entry,
create_meta("Active Heater",
"active_heater",
None,
None,
None,
"mdi:fraction-one-half",
),
)
)
if device.temp_1 != -1:
sensors.append(
MyenergiSensor(
Expand Down

0 comments on commit 294eb3e

Please sign in to comment.