forked from home-assistant/core
Increase test coverage in Brother integration (#51657)
This commit is contained in:
@@ -30,9 +30,9 @@ def host_valid(host: str) -> bool:
|
|||||||
if ipaddress.ip_address(host).version in [4, 6]:
|
if ipaddress.ip_address(host).version in [4, 6]:
|
||||||
return True
|
return True
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
pass
|
||||||
disallowed = re.compile(r"[^a-zA-Z\d\-]")
|
disallowed = re.compile(r"[^a-zA-Z\d\-]")
|
||||||
return all(x and not disallowed.search(x) for x in host.split("."))
|
return all(x and not disallowed.search(x) for x in host.split("."))
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
class BrotherConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
class BrotherConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
Reference in New Issue
Block a user