You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I see there is no command line option to obtain the token for a device with a specific IP address by just sending the special UDP package (21310020ff...) to port 54321 and extract the token.
Here are some hacky lines to extend the discover option, which should do the job but are not good enough for a pull request 😉:
@cli.command()
@click.option('--handshake', type=bool, default=False)
+ @click.option('--ip', envvar="MIROBO_IP", callback=validate_ip)
def discover(handshake, ip):
"""Search for robots in the network."""
+ if ip:+ vac = miio.Vacuum(ip)+ m = vac.do_discover()+ import binascii+ import codecs+ _LOGGER.info(" IP %s (ID: %s) - token: %s",+ ip,+ binascii.hexlify(m.header.value.device_id).decode(),+ codecs.encode(m.checksum, 'hex'))+ return
if handshake:
miio.Vacuum.discover()
else:
miio.Discovery.discover_mdns()
P. S.: Thanks for your project.
The text was updated successfully, but these errors were encountered:
The handshake handling could really use some cleaning up to make it also nicer for external use, there is #152 which goes towards this direction and we are open for PRs to make it happen :-)
As far as I see there is no command line option to obtain the token for a device with a specific IP address by just sending the special UDP package (
21310020ff...
) to port 54321 and extract the token.Here are some hacky lines to extend the discover option, which should do the job but are not good enough for a pull request 😉:
P. S.: Thanks for your project.
The text was updated successfully, but these errors were encountered: