Skip to content
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
18 changes: 10 additions & 8 deletions custom_components/plugwise-beta/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,17 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
if data[sensor] is not None:
if "power" in device["types"]:
if "off" in sensor:
if api._power_tariff is None:
continue
elif (
api._power_tariff[
"electricity_consumption_tariff_structure"
]
== "single"
):
tariff="electricity_consumption_tariff_structure"
if not tariff in api._power_tariff:
continue
else:
if (
api._power_tariff[
"electricity_consumption_tariff_structure"
]
== "single"
):
continue
devices.append(
PwPowerSensor(
api,
Expand Down