Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion mirobo/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import ipaddress
import inspect
import codecs
from mirobo import (Device, Vacuum, Plug, PlugV1, Strip, AirPurifier, Ceil,
PhilipsEyecare)
from typing import Union, Callable, Dict
from mirobo import Device, Vacuum

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -49,6 +50,22 @@ def add_service(self, zeroconf, type, name):
class Discovery:
_mdns_device_map = {
"rockrobo-vacuum-v1": Vacuum,
"chuangmi-plug-m1": Plug,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'Plug'

"chuangmi-plug-v2": Plug,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'Plug'

"chuangmi-plug-v1": PlugV1,
"qmi-powerstrip-v1": Strip,
"zimi.powerstrip.v2": Strip,
"zhimi-airpurifier-m1": AirPurifier,
"zhimi-airpurifier-v1": AirPurifier,
"zhimi-airpurifier-v2": AirPurifier,
"zhimi-airpurifier-v3": AirPurifier,
"zhimi-airpurifier-v6": AirPurifier,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'AirPurifier'

# "zhimi-humidifier-v1": Humidifier,
# "yunmi-waterpuri-v2": WaterPurifier,
# It looks like philips devices cannot be discovered via mdns
"philips-light-bulb": Ceil,
"philips-light-ceil": Ceil,
"philips-light-sread1": PhilipsEyecare,
"yeelink-light-": lambda x: other_package_info(x, "python-yeelight package"),
"lumi-gateway-": lambda x: other_package_info(x, "https://github.com/Danielhiversen/PyXiaomiGateway")
} # type: Dict[str, Union[Callable, Device]]
Expand Down