From 16ae076b87f726d55cfb97f111a8c739920abcfd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:40:03 +0000 Subject: [PATCH 1/2] chore: pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.19.1 → v2.3.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.19.1...v2.3.0) - [github.com/astral-sh/ruff-pre-commit: v0.14.10 → v0.16.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.10...v0.16.2) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e5d48502..537f211e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,11 +11,11 @@ repos: - id: check-ast - id: check-toml - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.19.1 + rev: v2.3.0 hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.10 + rev: v0.16.2 hooks: - id: ruff-check args: [ --fix, --config=ruff.toml ] From 12f34b9b7299fd7741e25c88ae177bc3c562bc70 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:40:13 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pyvesync/base_devices/outlet_base.py | 6 +++--- src/pyvesync/devices/vesyncpurifier.py | 4 ++-- src/pyvesync/models/bulb_models.py | 4 ++-- src/pyvesync/models/purifier_models.py | 2 +- src/pyvesync/models/vesync_models.py | 8 ++++---- src/pyvesync/utils/errors.py | 2 +- src/pyvesync/vesync.py | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pyvesync/base_devices/outlet_base.py b/src/pyvesync/base_devices/outlet_base.py index df3d2ec1..65f7892d 100644 --- a/src/pyvesync/base_devices/outlet_base.py +++ b/src/pyvesync/base_devices/outlet_base.py @@ -113,7 +113,7 @@ def __init__( self.protectionStatus: str | None = None self.currentUpperThreshold: float | None = None - def annual_history_to_json(self) -> None | str: + def annual_history_to_json(self) -> str | None: """Dump annual history.""" if not self.device.supports_energy: logger.info('Device does not support energy monitoring.') @@ -123,7 +123,7 @@ def annual_history_to_json(self) -> None | str: return None return self.yearly_history.to_json() - def monthly_history_to_json(self) -> None | str: + def monthly_history_to_json(self) -> str | None: """Dump monthly history.""" if not self.device.supports_energy: logger.info('Device does not support energy monitoring.') @@ -133,7 +133,7 @@ def monthly_history_to_json(self) -> None | str: return None return self.monthly_history.to_json() - def weekly_history_to_json(self) -> None | str: + def weekly_history_to_json(self) -> str | None: """Dump weekly history.""" if not self.device.supports_energy: logger.info('Device does not support energy monitoring.') diff --git a/src/pyvesync/devices/vesyncpurifier.py b/src/pyvesync/devices/vesyncpurifier.py index ba3ba808..4d7546a8 100644 --- a/src/pyvesync/devices/vesyncpurifier.py +++ b/src/pyvesync/devices/vesyncpurifier.py @@ -228,7 +228,7 @@ async def set_auto_preference(self, preference: str, room_size: int = 800) -> bo self.state.auto_room_size = room_size return True - async def set_fan_speed(self, speed: None | int = None) -> bool: + async def set_fan_speed(self, speed: int | None = None) -> bool: speeds: list = self.fan_levels current_speed = self.state.fan_level @@ -674,7 +674,7 @@ async def set_auto_preference( self.state.connection_status = ConnectionStatus.ONLINE return True - async def set_fan_speed(self, speed: None | int = None) -> bool: + async def set_fan_speed(self, speed: int | None = None) -> bool: if speed is not None: if speed not in self.fan_levels: _LOGGER.warning( diff --git a/src/pyvesync/models/bulb_models.py b/src/pyvesync/models/bulb_models.py index f73ce08a..95f3a08e 100644 --- a/src/pyvesync/models/bulb_models.py +++ b/src/pyvesync/models/bulb_models.py @@ -22,8 +22,8 @@ class JSONCMD(DataClassORJSONMixin): """Tunable Bulb JSON CMD dict.""" - light: None | JSONCMDLight = None - getLightStatus: None | str = None + light: JSONCMDLight | None = None + getLightStatus: str | None = None class Config(BaseConfig): """Configure the JSONCMD model.""" diff --git a/src/pyvesync/models/purifier_models.py b/src/pyvesync/models/purifier_models.py index d510ef33..cf60bafd 100644 --- a/src/pyvesync/models/purifier_models.py +++ b/src/pyvesync/models/purifier_models.py @@ -192,7 +192,7 @@ class PurifierCoreDetailsConfig(ResponseBaseModel): display: bool display_forever: bool - auto_preference: None | PurifierCoreAutoConfig = None + auto_preference: PurifierCoreAutoConfig | None = None @dataclass diff --git a/src/pyvesync/models/vesync_models.py b/src/pyvesync/models/vesync_models.py index 875f13b4..a4484d99 100644 --- a/src/pyvesync/models/vesync_models.py +++ b/src/pyvesync/models/vesync_models.py @@ -278,10 +278,10 @@ class InternalDeviceListExtension(ResponseBaseModel): the extension field in the device list response. """ - airQuality: None | int - airQualityLevel: None | int - mode: None | str - fanSpeedLevel: None | str + airQuality: int | None + airQualityLevel: int | None + mode: str | None + fanSpeedLevel: str | None @dataclass diff --git a/src/pyvesync/utils/errors.py b/src/pyvesync/utils/errors.py index 393b03a9..b917ab4a 100644 --- a/src/pyvesync/utils/errors.py +++ b/src/pyvesync/utils/errors.py @@ -841,7 +841,7 @@ def __init__(self) -> None: class VeSyncAPIResponseError(VeSyncError): """Exception raised for malformed VeSync API responses.""" - def __init__(self, msg: None | str = None) -> None: + def __init__(self, msg: str | None = None) -> None: """Initialize the exception with a message.""" if msg is None: msg = 'Unexpected VeSync API response.' diff --git a/src/pyvesync/vesync.py b/src/pyvesync/vesync.py index 63ffc436..99da0ee5 100644 --- a/src/pyvesync/vesync.py +++ b/src/pyvesync/vesync.py @@ -439,7 +439,7 @@ async def async_call_api( self, api: str, method: str, - json_object: dict | None | DataClassORJSONMixin = None, + json_object: dict | DataClassORJSONMixin | None = None, headers: dict | None = None, device: VeSyncBaseDevice | None = None, ) -> tuple[dict | None, int]: