Skip to content

Commit

Permalink
Use "get_properties" instead of "get_prop" for miot devices (rytilaht…
Browse files Browse the repository at this point in the history
…i#745)

This regression was caused by clean-up done in rytilahti#657

Fixes rytilahti#730
  • Loading branch information
rytilahti authored and xvlady committed May 9, 2021
1 parent 83f91b2 commit 284644f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions miio/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ def configure_wifi(self, ssid, password, uid=0, extra_params=None):

return self.send("miIO.config_router", params)[0]

def get_properties(self, properties, *, max_properties=None):
def get_properties(
self, properties, *, property_getter="get_prop", max_properties=None
):
"""Request properties in slices based on given max_properties.
This is necessary as some devices have limitation on how many
Expand All @@ -227,7 +229,7 @@ def get_properties(self, properties, *, max_properties=None):
_props = properties.copy()
values = []
while _props:
values.extend(self.send("get_prop", _props[:max_properties]))
values.extend(self.send(property_getter, _props[:max_properties]))
if max_properties is None:
break

Expand Down

0 comments on commit 284644f

Please sign in to comment.