Skip to content

Commit

Permalink
Bump black from 23.12.1 to 24.1.1 (#806)
Browse files Browse the repository at this point in the history
* Bump black from 23.12.1 to 24.1.1

Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.1.1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.12.1...24.1.1)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump pre-commit black hook to 24.1.1

* Run black

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <[email protected]>
  • Loading branch information
dependabot[bot] and MartinHjelmare authored Feb 1, 2024
1 parent ba689ef commit af7a13a
Show file tree
Hide file tree
Showing 44 changed files with 51 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
args:
- --fix
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
name: black
Expand Down
1 change: 1 addition & 0 deletions pytradfri/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implement an API wrapper around Ikea Tradfri."""

from pathlib import Path

from .error import (
Expand Down
1 change: 1 addition & 0 deletions pytradfri/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide a CLI for Tradfri."""

from __future__ import annotations

import argparse
Expand Down
13 changes: 5 additions & 8 deletions pytradfri/api/aiocoap_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""COAP implementation using aiocoap."""

from __future__ import annotations

import asyncio
Expand Down Expand Up @@ -41,14 +42,12 @@ class APIRequestProtocol(Protocol):
@overload
async def __call__(
self, api_commands: Command[T], timeout: float | None = None
) -> T:
...
) -> T: ...

@overload
async def __call__(
self, api_commands: list[Command[T]], timeout: float | None = None
) -> list[T]:
...
) -> list[T]: ...

async def __call__(
self, api_commands: Command[T] | list[Command[T]], timeout: float | None = None
Expand Down Expand Up @@ -214,14 +213,12 @@ async def _execute(self, api_command: Command[T], timeout: float | None) -> T:
@overload
async def request(
self, api_commands: Command[T], timeout: float | None = None
) -> T:
...
) -> T: ...

@overload
async def request(
self, api_commands: list[Command[T]], timeout: float | None = None
) -> list[T]:
...
) -> list[T]: ...

async def request(
self, api_commands: Command[T] | list[Command[T]], timeout: float | None = None
Expand Down
13 changes: 5 additions & 8 deletions pytradfri/api/libcoap_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""COAP implementation."""

from __future__ import annotations

import json
Expand All @@ -21,14 +22,12 @@ class APIRequestProtocol(Protocol):
"""Represent the protocol for the APIFactory request method."""

@overload
def __call__(self, api_commands: Command[T], timeout: int | None = None) -> T:
...
def __call__(self, api_commands: Command[T], timeout: int | None = None) -> T: ...

@overload
def __call__(
self, api_commands: list[Command[T]], timeout: int | None = None
) -> list[T]:
...
) -> list[T]: ...

def __call__(
self, api_commands: Command[T] | list[Command[T]], timeout: int | None = None
Expand Down Expand Up @@ -125,14 +124,12 @@ def _execute(self, api_command: Command[T], *, timeout: int | None = None) -> T:
return api_command.result

@overload
def request(self, api_commands: Command[T], timeout: int | None = None) -> T:
...
def request(self, api_commands: Command[T], timeout: int | None = None) -> T: ...

@overload
def request(
self, api_commands: list[Command[T]], timeout: int | None = None
) -> list[T]:
...
) -> list[T]: ...

def request(
self, api_commands: Command[T] | list[Command[T]], timeout: int | None = None
Expand Down
1 change: 1 addition & 0 deletions pytradfri/color.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Color."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions pytradfri/command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command implementation."""

from __future__ import annotations

from collections.abc import Callable
Expand Down
1 change: 1 addition & 0 deletions pytradfri/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants."""

from typing import Final

ROOT_DEVICES: Final = "15001"
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Classes to interact with devices."""

from __future__ import annotations

from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/air_purifier.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Represent an air purifier."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/air_purifier_control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class to control the air purifiers."""

from __future__ import annotations

from ..command import Command
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/base_controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base class for a controller."""

from __future__ import annotations

from abc import abstractmethod
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/blind.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Represent a blind."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/blind_control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class to control the blinds."""

from __future__ import annotations

from ..command import Command
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Represent a light."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/light_control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class to control the lights."""

from __future__ import annotations

from collections.abc import Mapping, Sequence
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/signal_repeater.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Represent a signal repeater."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/signal_repeater_control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class to control the signal repeater."""

from __future__ import annotations

from .base_controller import BaseController
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/socket.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Represent a socket."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions pytradfri/device/socket_control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class to control the sockets."""

from __future__ import annotations

from ..command import Command
Expand Down
1 change: 1 addition & 0 deletions pytradfri/gateway.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Represent the gateway."""

from __future__ import annotations

from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions pytradfri/group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Group handling."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions pytradfri/mood.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Represent a mood on the gateway."""

from __future__ import annotations

from .const import ROOT_MOODS
Expand Down
1 change: 1 addition & 0 deletions pytradfri/resource.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Resources for devices."""

from __future__ import annotations

from abc import abstractmethod
Expand Down
1 change: 1 addition & 0 deletions pytradfri/smart_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
StartActionItem # Get info on specific device in task
StartActionItemController # change values for task
"""

from __future__ import annotations

from datetime import datetime as dt, time, timedelta
Expand Down
1 change: 1 addition & 0 deletions pytradfri/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""JSON utility functions."""

from __future__ import annotations

from collections.abc import Iterator
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==23.12.1
black==24.1.1
coverage==7.4.1
mypy==1.8.0
pre-commit==3.6.0
Expand Down
1 change: 1 addition & 0 deletions tests/api/test_aiocoap_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test aiocoap API."""

from typing import Any

from aiocoap import Message
Expand Down
1 change: 1 addition & 0 deletions tests/api/test_libcoap_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test API utilities."""

import json

from pytradfri.api.libcoap_api import APIFactory
Expand Down
1 change: 1 addition & 0 deletions tests/devices.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Devices: Retrieved from Gateway running on 1.2.42."""

LIGHT_W = {
"3": {
"0": "IKEA of Sweden",
Expand Down
1 change: 1 addition & 0 deletions tests/moods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mood definitions: retrieved from Gateway running on 1.9.27."""

MOOD = {
"9001": "FOCUS",
"9002": 1577189497,
Expand Down
1 change: 1 addition & 0 deletions tests/test_air_purifiers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Air Purifiers."""

import pytest

from pytradfri.device import Device
Expand Down
1 change: 1 addition & 0 deletions tests/test_blinds.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Blinds."""

import pytest

from pytradfri.device import Device
Expand Down
1 change: 1 addition & 0 deletions tests/test_color.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Color."""

from pytradfri.color import supported_features
from pytradfri.const import (
ATTR_LIGHT_CONTROL,
Expand Down
1 change: 1 addition & 0 deletions tests/test_command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Command."""

from pytradfri.command import Command


Expand Down
1 change: 1 addition & 0 deletions tests/test_device.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Device."""

from copy import deepcopy
from datetime import datetime

Expand Down
1 change: 1 addition & 0 deletions tests/test_gateway.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Gateway."""

from copy import deepcopy
from datetime import datetime

Expand Down
1 change: 1 addition & 0 deletions tests/test_group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Group."""

import pytest

from pytradfri import error
Expand Down
1 change: 1 addition & 0 deletions tests/test_light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Light."""

import pytest

from pytradfri import error
Expand Down
1 change: 1 addition & 0 deletions tests/test_mood.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test mood."""

import pytest

from pytradfri.const import ROOT_MOODS
Expand Down
1 change: 0 additions & 1 deletion tests/test_signal_repeater.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Test for the signal repeater device."""


from pytradfri.device import Device

from tests.devices import SIGNAL_REPEATER
Expand Down
1 change: 1 addition & 0 deletions tests/test_smart_task.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test smart_task."""

import datetime

from pytradfri.gateway import Gateway
Expand Down
1 change: 1 addition & 0 deletions tests/test_socket.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Socket."""

from pytradfri.device import Device

from .devices import OUTLET
Expand Down
1 change: 1 addition & 0 deletions tests/test_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Util."""

import json
from os import path
import shutil
Expand Down

0 comments on commit af7a13a

Please sign in to comment.