Skip to content

Commit

Permalink
Add networkUp payload check
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Nov 30, 2020
1 parent bb21ee6 commit 4ae31c7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions custom_components/xiaomi_gateway3/core/gateway3.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,14 @@ def process_gw_message(self, payload: dict):
return

if 'networkUp' in payload:
payload = {
'network_pan_id': payload['networkPanId'],
'radio_tx_power': payload['radioTxPower'],
'radio_channel': payload['radioChannel'],
}
try:
payload = {
'network_pan_id': payload['networkPanId'],
'radio_tx_power': payload['radioTxPower'],
'radio_channel': payload['radioChannel'],
}
except:
_LOGGER.warning(f"Wrong gw payload: {payload}")
elif 'online' in payload:
self.device['online'] = payload['online']

Expand Down

0 comments on commit 4ae31c7

Please sign in to comment.