Use UsbServiceInfo in modem_callerid (#60268)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/60277/head
parent
c0d2a66609
commit
4ffb0b8380
|
@ -32,10 +32,10 @@ class PhoneModemFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
|
||||
async def async_step_usb(self, discovery_info: usb.UsbServiceInfo) -> FlowResult:
|
||||
"""Handle USB Discovery."""
|
||||
device = discovery_info["device"]
|
||||
device = discovery_info.device
|
||||
|
||||
dev_path = await self.hass.async_add_executor_job(usb.get_serial_by_id, device)
|
||||
unique_id = f"{discovery_info['vid']}:{discovery_info['pid']}_{discovery_info['serial_number']}_{discovery_info['manufacturer']}_{discovery_info['description']}"
|
||||
unique_id = f"{discovery_info.vid}:{discovery_info.pid}_{discovery_info.serial_number}_{discovery_info.manufacturer}_{discovery_info.description}"
|
||||
if (
|
||||
await self.validate_device_errors(dev_path=dev_path, unique_id=unique_id)
|
||||
is None
|
||||
|
|
|
@ -17,14 +17,14 @@ from homeassistant.data_entry_flow import (
|
|||
|
||||
from . import _patch_config_flow_modem
|
||||
|
||||
DISCOVERY_INFO = {
|
||||
"device": phone_modem.DEFAULT_PORT,
|
||||
"pid": "1340",
|
||||
"vid": "0572",
|
||||
"serial_number": "1234",
|
||||
"description": "modem",
|
||||
"manufacturer": "Connexant",
|
||||
}
|
||||
DISCOVERY_INFO = usb.UsbServiceInfo(
|
||||
device=phone_modem.DEFAULT_PORT,
|
||||
pid="1340",
|
||||
vid="0572",
|
||||
serial_number="1234",
|
||||
description="modem",
|
||||
manufacturer="Connexant",
|
||||
)
|
||||
|
||||
|
||||
def _patch_setup():
|
||||
|
|
Loading…
Reference in New Issue