mirror of
https://github.com/magico13/ha-emporia-vue.git
synced 2026-01-08 20:07:56 -05:00
Actually fixed this time
This commit is contained in:
@@ -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
|
||||
@@ -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)
|
||||
@@ -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:
|
||||
|
||||
@@ -73,7 +73,7 @@ class CurrentVuePowerSensor(CoordinatorEntity, SensorEntity):
|
||||
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}"
|
||||
|
||||
Reference in New Issue
Block a user