Skip to content

Commit

Permalink
Bump python-typing-update to 0.3.2 (home-assistant#48303)
Browse files Browse the repository at this point in the history
* Bump python-version-update to 0.3.2
* Changes after update
* Fix pylint issues
  • Loading branch information
cdce8p authored Mar 25, 2021
1 parent 88b5eff commit 1dc25a5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ repos:
- id: prettier
stages: [manual]
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.3.0
rev: v0.3.2
hooks:
# Run `python-typing-update` hook manually from time to time
# to update python typing syntax.
Expand Down
6 changes: 4 additions & 2 deletions homeassistant/auth/permissions/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Models for permissions."""
from __future__ import annotations

from typing import TYPE_CHECKING

import attr
Expand All @@ -14,5 +16,5 @@
class PermissionLookup:
"""Class to hold data for permission lookups."""

entity_registry: "ent_reg.EntityRegistry" = attr.ib()
device_registry: "dev_reg.DeviceRegistry" = attr.ib()
entity_registry: ent_reg.EntityRegistry = attr.ib()
device_registry: dev_reg.DeviceRegistry = attr.ib()
5 changes: 2 additions & 3 deletions homeassistant/components/deconz/fan.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Support for deCONZ fans."""

from typing import Optional
from __future__ import annotations

from homeassistant.components.fan import (
DOMAIN,
Expand Down Expand Up @@ -76,7 +75,7 @@ def is_on(self) -> bool:
return self._device.speed != 0

@property
def percentage(self) -> Optional[int]:
def percentage(self) -> int | None:
"""Return the current speed percentage."""
if self._device.speed == 0:
return 0
Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/yeelight/light.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"""Light platform support for yeelight."""
from __future__ import annotations

from functools import partial
import logging

import voluptuous as vol
import yeelight
from yeelight import (
Bulb,
BulbException,
Flow,
RGBTransition,
Expand Down Expand Up @@ -529,9 +532,8 @@ def effect(self):
"""Return the current effect."""
return self._effect

# F821: https://github.com/PyCQA/pyflakes/issues/373
@property
def _bulb(self) -> "Bulb": # noqa: F821
def _bulb(self) -> Bulb:
return self.device.bulb

@property
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/util/async_.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Asyncio utilities."""
from __future__ import annotations

from asyncio import Semaphore, coroutines, ensure_future, gather, get_running_loop
from asyncio.events import AbstractEventLoop
import concurrent.futures
Expand Down Expand Up @@ -38,7 +40,7 @@ def callback() -> None:

def run_callback_threadsafe(
loop: AbstractEventLoop, callback: Callable[..., T], *args: Any
) -> "concurrent.futures.Future[T]":
) -> concurrent.futures.Future[T]: # pylint: disable=unsubscriptable-object
"""Submit a callback object to a given event loop.
Return a concurrent.futures.Future to access the result.
Expand Down

0 comments on commit 1dc25a5

Please sign in to comment.