Skip to content

Commit

Permalink
Upgrade pyupgrade to v2.11.0 (home-assistant#48220)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Mar 22, 2021
1 parent 272dffc commit dc15f24
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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__)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/esphome/entry_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/http/web_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class HomeAssistantTCPSite(web.BaseSite):

def __init__(
self,
runner: "web.BaseRunner",
runner: web.BaseRunner,
host: None | str | list[str],
port: int,
*,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/wunderground/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(
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",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/zha/core/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def async_load(self) -> None:
"""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"]:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/helpers/device_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/helpers/entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def async_get_or_create(
# 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,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/helpers/sun.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dc15f24

Please sign in to comment.