Skip to content

Commit

Permalink
Unpack map before iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
jertel committed Aug 19, 2021
1 parent e27a643 commit bdf4dcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vuegraf/vuegraf.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def extractDataPoints(device, usageDataPoints):
for chanNum, chan in device.channels.items():
if not chanNum in excludedChannelNumbers:

for gid, nestedDevice in chan.nested_devices:
extractDataPoints(nestedDevice, usageDataPoints)
if chan.nested_devices:
for gid, nestedDevice in chan.nested_devices.items():
extractDataPoints(nestedDevice, usageDataPoints)

kwhUsage = chan.usage
if kwhUsage is not None:
Expand Down

0 comments on commit bdf4dcf

Please sign in to comment.