Update typing 03 (#48015)

This commit is contained in:
Marc Mueller 2021-03-17 21:46:07 +01:00 committed by GitHub
parent 6fb2e63e49
commit fabd73f08b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 417 additions and 379 deletions

View file

@ -1,5 +1,7 @@
"""Example auth module."""
from typing import Any, Dict
from __future__ import annotations
from typing import Any
import voluptuous as vol
@ -28,7 +30,7 @@ class InsecureExampleModule(MultiFactorAuthModule):
DEFAULT_TITLE = "Insecure Personal Identify Number"
def __init__(self, hass: HomeAssistant, config: Dict[str, Any]) -> None:
def __init__(self, hass: HomeAssistant, config: dict[str, Any]) -> None:
"""Initialize the user data store."""
super().__init__(hass, config)
self._data = config["data"]
@ -80,7 +82,7 @@ class InsecureExampleModule(MultiFactorAuthModule):
return True
return False
async def async_validate(self, user_id: str, user_input: Dict[str, Any]) -> bool:
async def async_validate(self, user_id: str, user_input: dict[str, Any]) -> bool:
"""Return True if validation passed."""
for data in self._data:
if data["user_id"] == user_id: