Add ruff rules PIE790, PIE794, PIE807, PIE810 (#113617)

This commit is contained in:
Sid 2024-03-16 22:04:58 +01:00 committed by GitHub
parent cbe2a5883b
commit 0b9c9aff62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 29 additions and 47 deletions

View file

@ -36,7 +36,7 @@ class UptimeRobotConfigFlow(ConfigFlow, domain=DOMAIN):
errors: dict[str, str] = {}
response: UptimeRobotApiResponse | UptimeRobotApiError | None = None
key: str = data[CONF_API_KEY]
if key.startswith("ur") or key.startswith("m"):
if key.startswith(("ur", "m")):
LOGGER.error("Wrong API key type detected, use the 'main' API key")
errors["base"] = "not_main_key"
return errors, None