Upgrade pyupgrade to v2.11.0 (#48220)
This commit is contained in:
parent
272dffc384
commit
dc15f243e6
11 changed files with 12 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
repos:
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v2.10.1
|
||||
rev: v2.11.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py38-plus]
|
||||
|
|
|
@ -46,7 +46,7 @@ class User:
|
|||
credentials: list[Credentials] = attr.ib(factory=list, eq=False, order=False)
|
||||
|
||||
# Tokens associated with a user.
|
||||
refresh_tokens: dict[str, "RefreshToken"] = attr.ib(
|
||||
refresh_tokens: dict[str, RefreshToken] = attr.ib(
|
||||
factory=dict, eq=False, order=False
|
||||
)
|
||||
|
||||
|
@ -109,7 +109,7 @@ class RefreshToken:
|
|||
last_used_at: datetime | None = attr.ib(default=None)
|
||||
last_used_ip: str | None = attr.ib(default=None)
|
||||
|
||||
credential: "Credentials" | None = attr.ib(default=None)
|
||||
credential: Credentials | None = attr.ib(default=None)
|
||||
|
||||
version: str | None = attr.ib(default=__version__)
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class RuntimeEntryData:
|
|||
# If an entity can't find anything in the info array, it will look for info here.
|
||||
old_info: dict[str, dict[str, Any]] = attr.ib(factory=dict)
|
||||
|
||||
services: dict[int, "UserService"] = attr.ib(factory=dict)
|
||||
services: dict[int, UserService] = attr.ib(factory=dict)
|
||||
available: bool = attr.ib(default=False)
|
||||
device_info: DeviceInfo | None = attr.ib(default=None)
|
||||
cleanup_callbacks: list[Callable[[], None]] = attr.ib(factory=list)
|
||||
|
|
|
@ -25,7 +25,7 @@ class HomeAssistantTCPSite(web.BaseSite):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
runner: "web.BaseRunner",
|
||||
runner: web.BaseRunner,
|
||||
host: None | str | list[str],
|
||||
port: int,
|
||||
*,
|
||||
|
|
|
@ -68,7 +68,7 @@ class WUSensorConfig:
|
|||
self,
|
||||
friendly_name: str | Callable,
|
||||
feature: str,
|
||||
value: Callable[["WUndergroundData"], Any],
|
||||
value: Callable[[WUndergroundData], Any],
|
||||
unit_of_measurement: str | None = None,
|
||||
entity_picture=None,
|
||||
icon: str = "mdi:gauge",
|
||||
|
|
|
@ -93,7 +93,7 @@ class ZhaStorage:
|
|||
"""Load the registry of zha device entries."""
|
||||
data = await self._store.async_load()
|
||||
|
||||
devices: "OrderedDict[str, ZhaDeviceEntry]" = OrderedDict()
|
||||
devices: OrderedDict[str, ZhaDeviceEntry] = OrderedDict()
|
||||
|
||||
if data is not None:
|
||||
for device in data["devices"]:
|
||||
|
|
|
@ -115,7 +115,7 @@ class Unauthorized(HomeAssistantError):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
context: "Context" | None = None,
|
||||
context: Context | None = None,
|
||||
user_id: str | None = None,
|
||||
entity_id: str | None = None,
|
||||
config_entry_id: str | None = None,
|
||||
|
|
|
@ -688,7 +688,7 @@ def async_config_entry_disabled_by_changed(
|
|||
def async_cleanup(
|
||||
hass: HomeAssistantType,
|
||||
dev_reg: DeviceRegistry,
|
||||
ent_reg: "entity_registry.EntityRegistry",
|
||||
ent_reg: entity_registry.EntityRegistry,
|
||||
) -> None:
|
||||
"""Clean up device registry."""
|
||||
# Find all devices that are referenced by a config_entry.
|
||||
|
|
|
@ -222,7 +222,7 @@ class EntityRegistry:
|
|||
# To disable an entity if it gets created
|
||||
disabled_by: str | None = None,
|
||||
# Data that we want entry to have
|
||||
config_entry: "ConfigEntry" | None = None,
|
||||
config_entry: ConfigEntry | None = None,
|
||||
device_id: str | None = None,
|
||||
area_id: str | None = None,
|
||||
capabilities: dict[str, Any] | None = None,
|
||||
|
|
|
@ -54,7 +54,7 @@ def get_astral_event_next(
|
|||
|
||||
@callback
|
||||
def get_location_astral_event_next(
|
||||
location: "astral.Location",
|
||||
location: astral.Location,
|
||||
event: str,
|
||||
utc_point_in_time: datetime.datetime | None = None,
|
||||
offset: datetime.timedelta | None = None,
|
||||
|
|
|
@ -9,5 +9,5 @@ flake8==3.8.4
|
|||
isort==5.7.0
|
||||
pydocstyle==5.1.1
|
||||
python-typing-update==0.3.0
|
||||
pyupgrade==2.10.1
|
||||
pyupgrade==2.11.0
|
||||
yamllint==1.24.2
|
||||
|
|
Loading…
Add table
Reference in a new issue