From a7d1aaeb1c5a4be21368c9e1287cad3cd69d6280 Mon Sep 17 00:00:00 2001 From: takeshix Date: Sun, 4 Sep 2016 17:59:35 +0200 Subject: [PATCH] Fixed a bug in A_DeviceDescriptor_Read --- libknxmap/bus/tunnel.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libknxmap/bus/tunnel.py b/libknxmap/bus/tunnel.py index 7fa3dd7..b858d04 100644 --- a/libknxmap/bus/tunnel.py +++ b/libknxmap/bus/tunnel.py @@ -347,11 +347,11 @@ def apci_device_descriptor_read(self, target): sequence=self.tpci_seq_counts.get(target)) value = yield from self.send_data(tunnel_request.get_message(), target) yield from self.tpci_send_ncd(target) - cemi = value.body.get('cemi') - if isinstance(value, KnxTunnellingRequest) and \ - cemi.get('apci').get('type') == CEMI_APCI_TYPES.get('A_DeviceDescriptor_Response') and \ - cemi.get('data'): - return value.body.get('cemi').get('data') + if isinstance(value, KnxTunnellingRequest): + cemi = value.body.get('cemi') + if cemi.get('apci').get('type') == CEMI_APCI_TYPES.get('A_DeviceDescriptor_Response') and \ + cemi.get('data'): + return value.body.get('cemi').get('data') else: return False