Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensor fixes #396

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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