mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Bump python-typing-update to 0.3.2 (#48303)
* Bump python-version-update to 0.3.2 * Changes after update * Fix pylint issues
This commit is contained in:
parent
88b5eff726
commit
1dc25a5864
@ -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.
|
||||
|
@ -1,4 +1,6 @@
|
||||
"""Models for permissions."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import attr
|
||||
@ -14,5 +16,5 @@ if TYPE_CHECKING:
|
||||
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()
|
||||
|
@ -1,6 +1,5 @@
|
||||
"""Support for deCONZ fans."""
|
||||
|
||||
from typing import Optional
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.fan import (
|
||||
DOMAIN,
|
||||
@ -76,7 +75,7 @@ class DeconzFan(DeconzDevice, FanEntity):
|
||||
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
|
||||
|
@ -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,
|
||||
@ -529,9 +532,8 @@ class YeelightGenericLight(YeelightEntity, LightEntity):
|
||||
"""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
|
||||
|
@ -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
|
||||
@ -38,7 +40,7 @@ def fire_coroutine_threadsafe(coro: Coroutine, loop: AbstractEventLoop) -> 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user