Use dataclass properties in brother discovery (#60601)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
b996f624db
commit
0bb44c042c
1 changed files with 2 additions and 2 deletions
|
@ -84,13 +84,13 @@ class BrotherConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
) -> FlowResult:
|
) -> FlowResult:
|
||||||
"""Handle zeroconf discovery."""
|
"""Handle zeroconf discovery."""
|
||||||
# Hostname is format: brother.local.
|
# Hostname is format: brother.local.
|
||||||
self.host = discovery_info[zeroconf.ATTR_HOSTNAME].rstrip(".")
|
self.host = discovery_info.hostname.rstrip(".")
|
||||||
|
|
||||||
# Do not probe the device if the host is already configured
|
# Do not probe the device if the host is already configured
|
||||||
self._async_abort_entries_match({CONF_HOST: self.host})
|
self._async_abort_entries_match({CONF_HOST: self.host})
|
||||||
|
|
||||||
snmp_engine = get_snmp_engine(self.hass)
|
snmp_engine = get_snmp_engine(self.hass)
|
||||||
model = discovery_info[zeroconf.ATTR_PROPERTIES].get("product")
|
model = discovery_info.properties.get("product")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.brother = Brother(self.host, snmp_engine=snmp_engine, model=model)
|
self.brother = Brother(self.host, snmp_engine=snmp_engine, model=model)
|
||||||
|
|
Loading…
Add table
Reference in a new issue