diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ba82c4aa58..ab4d048deb8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,11 +69,12 @@ repos: hooks: - id: prettier - repo: https://github.com/cdce8p/python-typing-update - rev: v0.3.5 + rev: v0.5.0 hooks: # Run `python-typing-update` hook manually from time to time # to update python typing syntax. # Will require manual work, before submitting changes! + # pre-commit run --hook-stage manual python-typing-update --all-files - id: python-typing-update stages: [manual] args: diff --git a/homeassistant/components/hue/v1/device_trigger.py b/homeassistant/components/hue/v1/device_trigger.py index 4316ea65406..e3639e802da 100644 --- a/homeassistant/components/hue/v1/device_trigger.py +++ b/homeassistant/components/hue/v1/device_trigger.py @@ -1,4 +1,6 @@ """Provides device automations for Philips Hue events in V1 bridge/api.""" +from __future__ import annotations + from typing import TYPE_CHECKING import voluptuous as vol @@ -173,9 +175,7 @@ async def async_attach_trigger( @callback -def async_get_triggers( - bridge: "HueBridge", device: DeviceEntry -) -> list[dict[str, str]]: +def async_get_triggers(bridge: HueBridge, device: DeviceEntry) -> list[dict[str, str]]: """Return device triggers for device on `v1` bridge. Make sure device is a supported remote model. diff --git a/tests/components/airthings_ble/__init__.py b/tests/components/airthings_ble/__init__.py index c6b59e02c15..d480f44b27e 100644 --- a/tests/components/airthings_ble/__init__.py +++ b/tests/components/airthings_ble/__init__.py @@ -1,5 +1,6 @@ """Tests for the Airthings BLE integration.""" -from typing import Union +from __future__ import annotations + from unittest.mock import patch from airthings_ble import AirthingsBluetoothDeviceData, AirthingsDevice @@ -17,9 +18,7 @@ def patch_async_setup_entry(return_value=True): ) -def patch_async_ble_device_from_address( - return_value: Union[BluetoothServiceInfoBleak, None] -): +def patch_async_ble_device_from_address(return_value: BluetoothServiceInfoBleak | None): """Patch async ble device from address to return a given value.""" return patch( "homeassistant.components.bluetooth.async_ble_device_from_address",