mirror of
https://github.com/home-assistant/core.git
synced 2025-06-17 03:27:07 +00:00
Use UsbServiceInfo in zwave-js (#60267)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
3bf12fcd29
commit
5a8cbb8cab
@ -345,12 +345,12 @@ class ConfigFlow(BaseZwaveJSFlow, config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
if self._async_in_progress():
|
if self._async_in_progress():
|
||||||
return self.async_abort(reason="already_in_progress")
|
return self.async_abort(reason="already_in_progress")
|
||||||
|
|
||||||
vid = discovery_info["vid"]
|
vid = discovery_info.vid
|
||||||
pid = discovery_info["pid"]
|
pid = discovery_info.pid
|
||||||
serial_number = discovery_info["serial_number"]
|
serial_number = discovery_info.serial_number
|
||||||
device = discovery_info["device"]
|
device = discovery_info.device
|
||||||
manufacturer = discovery_info["manufacturer"]
|
manufacturer = discovery_info.manufacturer
|
||||||
description = discovery_info["description"]
|
description = discovery_info.description
|
||||||
# Zooz uses this vid/pid, but so do 2652 sticks
|
# Zooz uses this vid/pid, but so do 2652 sticks
|
||||||
if vid == "10C4" and pid == "EA60" and description and "2652" in description:
|
if vid == "10C4" and pid == "EA60" and description and "2652" in description:
|
||||||
return self.async_abort(reason="not_zwave_device")
|
return self.async_abort(reason="not_zwave_device")
|
||||||
|
@ -7,6 +7,7 @@ import pytest
|
|||||||
from zwave_js_server.version import VersionInfo
|
from zwave_js_server.version import VersionInfo
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
|
from homeassistant.components import usb
|
||||||
from homeassistant.components.hassio.handler import HassioAPIError
|
from homeassistant.components.hassio.handler import HassioAPIError
|
||||||
from homeassistant.components.zwave_js.config_flow import SERVER_VERSION_TIMEOUT, TITLE
|
from homeassistant.components.zwave_js.config_flow import SERVER_VERSION_TIMEOUT, TITLE
|
||||||
from homeassistant.components.zwave_js.const import DOMAIN
|
from homeassistant.components.zwave_js.const import DOMAIN
|
||||||
@ -20,32 +21,32 @@ ADDON_DISCOVERY_INFO = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
USB_DISCOVERY_INFO = {
|
USB_DISCOVERY_INFO = usb.UsbServiceInfo(
|
||||||
"device": "/dev/zwave",
|
device="/dev/zwave",
|
||||||
"pid": "AAAA",
|
pid="AAAA",
|
||||||
"vid": "AAAA",
|
vid="AAAA",
|
||||||
"serial_number": "1234",
|
serial_number="1234",
|
||||||
"description": "zwave radio",
|
description="zwave radio",
|
||||||
"manufacturer": "test",
|
manufacturer="test",
|
||||||
}
|
)
|
||||||
|
|
||||||
NORTEK_ZIGBEE_DISCOVERY_INFO = {
|
NORTEK_ZIGBEE_DISCOVERY_INFO = usb.UsbServiceInfo(
|
||||||
"device": "/dev/zigbee",
|
device="/dev/zigbee",
|
||||||
"pid": "8A2A",
|
pid="8A2A",
|
||||||
"vid": "10C4",
|
vid="10C4",
|
||||||
"serial_number": "1234",
|
serial_number="1234",
|
||||||
"description": "nortek zigbee radio",
|
description="nortek zigbee radio",
|
||||||
"manufacturer": "nortek",
|
manufacturer="nortek",
|
||||||
}
|
)
|
||||||
|
|
||||||
CP2652_ZIGBEE_DISCOVERY_INFO = {
|
CP2652_ZIGBEE_DISCOVERY_INFO = usb.UsbServiceInfo(
|
||||||
"device": "/dev/zigbee",
|
device="/dev/zigbee",
|
||||||
"pid": "EA60",
|
pid="EA60",
|
||||||
"vid": "10C4",
|
vid="10C4",
|
||||||
"serial_number": "",
|
serial_number="",
|
||||||
"description": "cp2652",
|
description="cp2652",
|
||||||
"manufacturer": "generic",
|
manufacturer="generic",
|
||||||
}
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="setup_entry")
|
@pytest.fixture(name="setup_entry")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user