-
-
Notifications
You must be signed in to change notification settings - Fork 568
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
Make vacuum robot wifi settings configurable via CLI #105
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,10 @@ def set_timezone(self, new_zone): | |
"""Set the timezone.""" | ||
return self.send("set_timezone", [new_zone])[0] == 'ok' | ||
|
||
def configure_wifi(self, ssid, password, uid=0): | ||
"""Configure the wifi settings.""" | ||
return self.send("miIO.config_router", { "ssid": ssid, "passwd": password, "uid": uid })[0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whitespace after '{' |
||
|
||
def raw_command(self, cmd, params): | ||
"""Send a raw command to the robot.""" | ||
return self.send(cmd, params) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -417,6 +417,18 @@ def timezone(vac: miio.Vacuum, tz=None): | |
click.echo("Timezone: %s" % vac.timezone()) | ||
|
||
|
||
@cli.command() | ||
@click.argument('ssid', required=True) | ||
@click.argument('password', required=True) | ||
@click.argument('uid', type=int, required=False) | ||
@pass_dev | ||
def configure_wifi(vac: miio.Vacuum, ssid: str, | ||
password: str, uid: int): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent |
||
"""Configure the wifi settings.""" | ||
click.echo("Configuring wifi to SSID: %s" % ssid) | ||
click.echo(vac.configure_wifi(ssid, password, uid)) | ||
|
||
|
||
@cli.command() | ||
@click.argument('cmd', required=True) | ||
@click.argument('parameters', required=False) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace after '{'
line too long (99 > 79 characters)
whitespace before '}'