Make use of str.removeprefix and .removesuffix (#85584)
This commit is contained in:
parent
d44210e573
commit
ae302bbec0
24 changed files with 33 additions and 52 deletions
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue