From 7cc7bbce73bf8bfa11b54b730195f493db9a326b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20S=C3=A1nchez=20Siles?= Date: Sun, 27 Aug 2023 00:17:33 +0200 Subject: [PATCH 1/2] xiaomi/wifirepeater: v3 config_router support --- .../xiaomi/repeater/wifirepeater.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/miio/integrations/xiaomi/repeater/wifirepeater.py b/miio/integrations/xiaomi/repeater/wifirepeater.py index 37889d20a..8d1bfa2f0 100644 --- a/miio/integrations/xiaomi/repeater/wifirepeater.py +++ b/miio/integrations/xiaomi/repeater/wifirepeater.py @@ -66,7 +66,7 @@ def ssid_hidden(self) -> bool: class WifiRepeater(Device): """Device class for Xiaomi Mi WiFi Repeater 2.""" - _supported_models = ["xiaomi.repeater.v2"] + _supported_models = ["xiaomi.repeater.v2", "xiaomi.repeater.v3"] @command( default_output=format_output( @@ -103,6 +103,22 @@ def set_wifi_roaming(self, wifi_roaming: bool): "miIO.switch_wifi_explorer", [{"wifi_explorer": int(wifi_roaming)}] ) + @command( + click.argument("ssid", type=str), + click.argument("password", type=str), + default_output=format_output("Updating the accespoint configuration"), + ) + def config_router(self, ssid: str, password: str): + """Update the configuration of the accesspoint.""" + return self.send( + "miIO.config_router", + { + "ssid": ssid, + "passwd": password, + "uid": 0, + } + ) + @command( click.argument("ssid", type=str), click.argument("password", type=str), From b711400da84b22b4468ce6ace56fa230c489d708 Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Thu, 5 Oct 2023 01:27:57 +0200 Subject: [PATCH 2/2] Fix linting --- miio/integrations/xiaomi/repeater/wifirepeater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miio/integrations/xiaomi/repeater/wifirepeater.py b/miio/integrations/xiaomi/repeater/wifirepeater.py index 8d1bfa2f0..2d719b48b 100644 --- a/miio/integrations/xiaomi/repeater/wifirepeater.py +++ b/miio/integrations/xiaomi/repeater/wifirepeater.py @@ -116,7 +116,7 @@ def config_router(self, ssid: str, password: str): "ssid": ssid, "passwd": password, "uid": 0, - } + }, ) @command(