Skip to content

Commit

Permalink
PEP8 format
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 26, 2018
1 parent 8016717 commit d3b55a1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pyzigate/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,21 +324,20 @@ def decode_data(self, data):
ZGT_LOG.debug(' - Power Source : {}'.format(msg['power_source']))
ZGT_LOG.debug(' - Link Quality : {}'.format(msg['link_quality']))
if int(msg['link_quality']) != 255:
#Found enpoint
# Found enpoint
for device in self._known_devices:
#If address match
if str(device[:4])==msg['addr'].decode('UTF-8'):
#Update the device with Link Quality value
self.set_device_property(msg['addr'], device[4:6].encode() , "Link_quality", '{}'.format(msg['link_quality']))
# If address match
if str(device[:4]) == msg['addr'].decode('UTF-8'):
# Update the device with Link Quality value
self.set_device_property(msg['addr'], device[4:6].encode(), "Link_quality", '{}'.format(msg['link_quality']))

else:
ZGT_LOG.error('{} dead ? '.format(msg['ID']))

if len(msg['next']) < 13:
break
else:
msg_data = msg['next']

# Node Descriptor
elif msg_type == b'8042':
struct = OrderedDict([('sequence', 8), ('status', 8), ('addr', 16),
Expand Down

0 comments on commit d3b55a1

Please sign in to comment.