Use dataclass properties in elgato discovery (#60588)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-11-30 08:53:03 +01:00 committed by GitHub
parent d74145ed7b
commit 64afe738cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,8 +46,8 @@ class ElgatoFlowHandler(ConfigFlow, domain=DOMAIN):
self, discovery_info: zeroconf.ZeroconfServiceInfo
) -> FlowResult:
"""Handle zeroconf discovery."""
self.host = discovery_info[zeroconf.ATTR_HOST]
self.port = discovery_info[zeroconf.ATTR_PORT] or 9123
self.host = discovery_info.host
self.port = discovery_info.port or 9123
try:
await self._get_elgato_serial_number()