miio.discovery module

class miio.discovery.Discovery[source]

Bases: object

mDNS discoverer for miIO based devices (_miio._udp.local).

Call discover_mdns() to discover devices advertising _miio._udp.local on the local network.

static discover_mdns(*, timeout=5) Dict[str, Device][source]

Discover devices with mdns.

class miio.discovery.Listener[source]

Bases: ServiceListener

mDNS listener creating Device objects for detected devices.

add_service(zeroconf: Zeroconf, type_: str, name: str) None[source]

Callback for discovery responses.

create_device(info, addr) Optional[Device][source]

Get a device instance for a mdns response.

remove_service(zc: Zeroconf, type_: str, name: str) None
update_service(zc: Zeroconf, type_: str, name: str) None[source]

Callback for state updates.