Make use of str.removeprefix and .removesuffix (#85584)

This commit is contained in:
Ville Skyttä 2023-01-13 13:19:38 +02:00 committed by GitHub
parent d44210e573
commit ae302bbec0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 33 additions and 52 deletions

View file

@ -106,7 +106,7 @@ class KodiConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle zeroconf discovery."""
self._host = discovery_info.host
self._port = discovery_info.port or DEFAULT_PORT
self._name = discovery_info.hostname[: -len(".local.")]
self._name = discovery_info.hostname.removesuffix(".local.")
if not (uuid := discovery_info.properties.get("uuid")):
return self.async_abort(reason="no_uuid")