Skip to content

Commit

Permalink
Actually fixed this time
Browse files Browse the repository at this point in the history
  • Loading branch information
magico13 committed Aug 18, 2021
1 parent a35c890 commit b1e8d48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions custom_components/emporia_vue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
for device in devices:
if not device.device_gid in device_gids:
device_gids.append(device.device_gid)
# await loop.run_in_executor(None, vue.populate_device_properties, device)
device_information[device.device_gid] = device
else:
device_information[device.device_gid].channels += device.channels
Expand Down Expand Up @@ -259,7 +260,7 @@ async def update_sensors(vue, scales):

def recurse_usage_data(usage_devices, scale, data):
for gid, device in usage_devices.items():
for channel_num, channel in device.channels:
for channel_num, channel in device.channels.items():
reset_datetime = None
id = make_channel_id(channel, scale)
info = find_device_info_for_channel(channel)
Expand All @@ -282,7 +283,7 @@ def find_device_info_for_channel(channel):
info = None
if channel.device_gid in device_information:
info = device_information[channel.device_gid]
if channel.channel_num in ["MainsFromGrid", "MainsToGrid"]:
if channel.channel_num in ["MainsFromGrid", "MainsToGrid", "Balance"]:
found = False
channel_123 = None
for channel2 in info.channels:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/emporia_vue/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, coordinator, id):
raise RuntimeError(
f"No channel found for device_gid {device_gid} and channel_num {channel_num}"
)
dName = self._device.name
dName = self._device.device_name
if self._channel.name and self._channel.name != "Main":
dName = self._channel.name
self._name = f"Power {dName} {channel_num} {self._scale}"
Expand Down

0 comments on commit b1e8d48

Please sign in to comment.