mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +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
|
- id: prettier
|
||||||
stages: [manual]
|
stages: [manual]
|
||||||
- repo: https://github.com/cdce8p/python-typing-update
|
- repo: https://github.com/cdce8p/python-typing-update
|
||||||
rev: v0.3.0
|
rev: v0.3.2
|
||||||
hooks:
|
hooks:
|
||||||
# Run `python-typing-update` hook manually from time to time
|
# Run `python-typing-update` hook manually from time to time
|
||||||
# to update python typing syntax.
|
# to update python typing syntax.
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
"""Models for permissions."""
|
"""Models for permissions."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
@ -14,5 +16,5 @@ if TYPE_CHECKING:
|
|||||||
class PermissionLookup:
|
class PermissionLookup:
|
||||||
"""Class to hold data for permission lookups."""
|
"""Class to hold data for permission lookups."""
|
||||||
|
|
||||||
entity_registry: "ent_reg.EntityRegistry" = attr.ib()
|
entity_registry: ent_reg.EntityRegistry = attr.ib()
|
||||||
device_registry: "dev_reg.DeviceRegistry" = attr.ib()
|
device_registry: dev_reg.DeviceRegistry = attr.ib()
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""Support for deCONZ fans."""
|
"""Support for deCONZ fans."""
|
||||||
|
from __future__ import annotations
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from homeassistant.components.fan import (
|
from homeassistant.components.fan import (
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
@ -76,7 +75,7 @@ class DeconzFan(DeconzDevice, FanEntity):
|
|||||||
return self._device.speed != 0
|
return self._device.speed != 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def percentage(self) -> Optional[int]:
|
def percentage(self) -> int | None:
|
||||||
"""Return the current speed percentage."""
|
"""Return the current speed percentage."""
|
||||||
if self._device.speed == 0:
|
if self._device.speed == 0:
|
||||||
return 0
|
return 0
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
"""Light platform support for yeelight."""
|
"""Light platform support for yeelight."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
import yeelight
|
import yeelight
|
||||||
from yeelight import (
|
from yeelight import (
|
||||||
|
Bulb,
|
||||||
BulbException,
|
BulbException,
|
||||||
Flow,
|
Flow,
|
||||||
RGBTransition,
|
RGBTransition,
|
||||||
@ -529,9 +532,8 @@ class YeelightGenericLight(YeelightEntity, LightEntity):
|
|||||||
"""Return the current effect."""
|
"""Return the current effect."""
|
||||||
return self._effect
|
return self._effect
|
||||||
|
|
||||||
# F821: https://github.com/PyCQA/pyflakes/issues/373
|
|
||||||
@property
|
@property
|
||||||
def _bulb(self) -> "Bulb": # noqa: F821
|
def _bulb(self) -> Bulb:
|
||||||
return self.device.bulb
|
return self.device.bulb
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
"""Asyncio utilities."""
|
"""Asyncio utilities."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from asyncio import Semaphore, coroutines, ensure_future, gather, get_running_loop
|
from asyncio import Semaphore, coroutines, ensure_future, gather, get_running_loop
|
||||||
from asyncio.events import AbstractEventLoop
|
from asyncio.events import AbstractEventLoop
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
@ -38,7 +40,7 @@ def fire_coroutine_threadsafe(coro: Coroutine, loop: AbstractEventLoop) -> None:
|
|||||||
|
|
||||||
def run_callback_threadsafe(
|
def run_callback_threadsafe(
|
||||||
loop: AbstractEventLoop, callback: Callable[..., T], *args: Any
|
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.
|
"""Submit a callback object to a given event loop.
|
||||||
|
|
||||||
Return a concurrent.futures.Future to access the result.
|
Return a concurrent.futures.Future to access the result.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user