Skip to content

Commit

Permalink
Update session.py
Browse files Browse the repository at this point in the history
Added support for unnamed devices
  • Loading branch information
sockless-coding committed Oct 9, 2022
1 parent 8ffcf31 commit 375caaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/panasonic_cc/pcomfortcloud/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def get_devices(self, group=None):
else:
list = group.get('deviceIdList', [])

for device in list:
for index, device in enumerate(list):
if device:
id = None
if 'deviceHashGuid' in device:
Expand All @@ -220,7 +220,7 @@ def get_devices(self, group=None):
self._deviceIndexer[id] = device['deviceGuid']
self._devices.append({
'id': id,
'name': device['deviceName'],
'name': device['deviceName'] if 'deviceName' in device else f"Unnamed Device #{index}",
'group': group['groupName'],
'model': device['deviceModuleNumber'] if 'deviceModuleNumber' in device else ''
})
Expand Down

0 comments on commit 375caaa

Please sign in to comment.