def discover(addr: str = None) -> Any:
"""Scan for devices in the network.
This method is used to discover supported devices by sending a
handshake message to the broadcast address on port 54321.
If the target IP address is given, the handshake will be send as
an unicast packet.
:param str addr: Target IP address"""
timeout = 5
is_broadcast = addr is None
seen_addrs = [] # type: List[str]
if is_broadcast:
addr = "<broadcast>"
is_broadcast = True
_LOGGER.info("Sending discovery to %s with timeout of %ss..", addr, timeout)
# magic, length 32
helobytes = bytes.fromhex(
"21310020ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
)
Hello,
Could you add firmware version to the web interface please? We can get that information from the 'miio inspect' command:
python-miio also have a discover method: https://github.com/rytilahti/python-miio/blob/master/miio/device.py#L176
https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/obtain_token.md#method-4a---packet-sender-tool
Regards