mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Upgrade pyupgrade to v2.11.0 (#48220)
This commit is contained in:
parent
272dffc384
commit
dc15f243e6
@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.10.1
|
rev: v2.11.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py38-plus]
|
args: [--py38-plus]
|
||||||
|
@ -46,7 +46,7 @@ class User:
|
|||||||
credentials: list[Credentials] = attr.ib(factory=list, eq=False, order=False)
|
credentials: list[Credentials] = attr.ib(factory=list, eq=False, order=False)
|
||||||
|
|
||||||
# Tokens associated with a user.
|
# 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
|
factory=dict, eq=False, order=False
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ class RefreshToken:
|
|||||||
last_used_at: datetime | None = attr.ib(default=None)
|
last_used_at: datetime | None = attr.ib(default=None)
|
||||||
last_used_ip: str | 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__)
|
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.
|
# 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)
|
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)
|
available: bool = attr.ib(default=False)
|
||||||
device_info: DeviceInfo | None = attr.ib(default=None)
|
device_info: DeviceInfo | None = attr.ib(default=None)
|
||||||
cleanup_callbacks: list[Callable[[], None]] = attr.ib(factory=list)
|
cleanup_callbacks: list[Callable[[], None]] = attr.ib(factory=list)
|
||||||
|
@ -25,7 +25,7 @@ class HomeAssistantTCPSite(web.BaseSite):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
runner: "web.BaseRunner",
|
runner: web.BaseRunner,
|
||||||
host: None | str | list[str],
|
host: None | str | list[str],
|
||||||
port: int,
|
port: int,
|
||||||
*,
|
*,
|
||||||
|
@ -68,7 +68,7 @@ class WUSensorConfig:
|
|||||||
self,
|
self,
|
||||||
friendly_name: str | Callable,
|
friendly_name: str | Callable,
|
||||||
feature: str,
|
feature: str,
|
||||||
value: Callable[["WUndergroundData"], Any],
|
value: Callable[[WUndergroundData], Any],
|
||||||
unit_of_measurement: str | None = None,
|
unit_of_measurement: str | None = None,
|
||||||
entity_picture=None,
|
entity_picture=None,
|
||||||
icon: str = "mdi:gauge",
|
icon: str = "mdi:gauge",
|
||||||
|
@ -93,7 +93,7 @@ class ZhaStorage:
|
|||||||
"""Load the registry of zha device entries."""
|
"""Load the registry of zha device entries."""
|
||||||
data = await self._store.async_load()
|
data = await self._store.async_load()
|
||||||
|
|
||||||
devices: "OrderedDict[str, ZhaDeviceEntry]" = OrderedDict()
|
devices: OrderedDict[str, ZhaDeviceEntry] = OrderedDict()
|
||||||
|
|
||||||
if data is not None:
|
if data is not None:
|
||||||
for device in data["devices"]:
|
for device in data["devices"]:
|
||||||
|
@ -115,7 +115,7 @@ class Unauthorized(HomeAssistantError):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
context: "Context" | None = None,
|
context: Context | None = None,
|
||||||
user_id: str | None = None,
|
user_id: str | None = None,
|
||||||
entity_id: str | None = None,
|
entity_id: str | None = None,
|
||||||
config_entry_id: str | None = None,
|
config_entry_id: str | None = None,
|
||||||
|
@ -688,7 +688,7 @@ def async_config_entry_disabled_by_changed(
|
|||||||
def async_cleanup(
|
def async_cleanup(
|
||||||
hass: HomeAssistantType,
|
hass: HomeAssistantType,
|
||||||
dev_reg: DeviceRegistry,
|
dev_reg: DeviceRegistry,
|
||||||
ent_reg: "entity_registry.EntityRegistry",
|
ent_reg: entity_registry.EntityRegistry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Clean up device registry."""
|
"""Clean up device registry."""
|
||||||
# Find all devices that are referenced by a config_entry.
|
# Find all devices that are referenced by a config_entry.
|
||||||
|
@ -222,7 +222,7 @@ class EntityRegistry:
|
|||||||
# To disable an entity if it gets created
|
# To disable an entity if it gets created
|
||||||
disabled_by: str | None = None,
|
disabled_by: str | None = None,
|
||||||
# Data that we want entry to have
|
# Data that we want entry to have
|
||||||
config_entry: "ConfigEntry" | None = None,
|
config_entry: ConfigEntry | None = None,
|
||||||
device_id: str | None = None,
|
device_id: str | None = None,
|
||||||
area_id: str | None = None,
|
area_id: str | None = None,
|
||||||
capabilities: dict[str, Any] | None = None,
|
capabilities: dict[str, Any] | None = None,
|
||||||
|
@ -54,7 +54,7 @@ def get_astral_event_next(
|
|||||||
|
|
||||||
@callback
|
@callback
|
||||||
def get_location_astral_event_next(
|
def get_location_astral_event_next(
|
||||||
location: "astral.Location",
|
location: astral.Location,
|
||||||
event: str,
|
event: str,
|
||||||
utc_point_in_time: datetime.datetime | None = None,
|
utc_point_in_time: datetime.datetime | None = None,
|
||||||
offset: datetime.timedelta | None = None,
|
offset: datetime.timedelta | None = None,
|
||||||
|
@ -9,5 +9,5 @@ flake8==3.8.4
|
|||||||
isort==5.7.0
|
isort==5.7.0
|
||||||
pydocstyle==5.1.1
|
pydocstyle==5.1.1
|
||||||
python-typing-update==0.3.0
|
python-typing-update==0.3.0
|
||||||
pyupgrade==2.10.1
|
pyupgrade==2.11.0
|
||||||
yamllint==1.24.2
|
yamllint==1.24.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user