Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error on GATEWAY_MODEL_ZIG3 when no zigbee devices connected #1065

Merged
merged 3 commits into from
Jun 4, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions miio/gateway/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ def discover_devices(self):
# self.send("get_device_list") does work for the GATEWAY_MODEL_ZIG3 but gives slightly diffrent return values
devices_raw = self.send("get_device_list")

if type(devices_raw) != list:
_LOGGER.debug("Gateway response to 'get_device_list' not a list type, no zigbee devices connected.")
return self._devices

for device in devices_raw:
# Match 'model' to get the model_info
model_info = self.match_zigbee_model(device["model"], device["did"])
Expand Down