From 4a36d7c281b4e03ebb07e3332fafdd3b4afa1005 Mon Sep 17 00:00:00 2001 From: cdpuk <24318424+cdpuk@users.noreply.github.com> Date: Tue, 9 Jul 2024 20:22:06 +0100 Subject: [PATCH] Rethink pinned dependencies to avoid conflicts (#90) --- .../givenergy_modbus/client/commands.py | 4 ++-- custom_components/givenergy_local/manifest.json | 7 ++----- hacs.json | 2 +- requirements.txt | 12 +++++++----- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/custom_components/givenergy_local/givenergy_modbus/client/commands.py b/custom_components/givenergy_local/givenergy_modbus/client/commands.py index 47c3f6d..e517852 100644 --- a/custom_components/givenergy_local/givenergy_modbus/client/commands.py +++ b/custom_components/givenergy_local/givenergy_modbus/client/commands.py @@ -1,8 +1,8 @@ """High-level methods for interacting with a remote system.""" +from datetime import datetime from typing import Optional -from arrow import Arrow from typing_extensions import deprecated # type: ignore[attr-defined] from custom_components.givenergy_local.givenergy_modbus.model import TimeSlot @@ -268,7 +268,7 @@ def reset_discharge_slot_2() -> list[TransparentRequest]: return _set_charge_slot(True, 2, None) -def set_system_date_time(dt: Arrow) -> list[TransparentRequest]: +def set_system_date_time(dt: datetime) -> list[TransparentRequest]: """Set the date & time of the inverter.""" return [ WriteHoldingRegisterRequest(RegisterMap.SYSTEM_TIME_YEAR, dt.year - 2000), diff --git a/custom_components/givenergy_local/manifest.json b/custom_components/givenergy_local/manifest.json index 0e47a79..1e777bf 100755 --- a/custom_components/givenergy_local/manifest.json +++ b/custom_components/givenergy_local/manifest.json @@ -11,11 +11,8 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/cdpuk/givenergy-local/issues", "requirements": [ - "aiofiles==0.8.0", - "arrow==1.2.3", - "crccheck==1.3.0", - "pydantic==1.10.15", - "aenum==3.1.12" + "crccheck~=1.3", + "pydantic>=1.10.12,<2" ], "version": "0.0.1" } \ No newline at end of file diff --git a/hacs.json b/hacs.json index c606421..502e009 100644 --- a/hacs.json +++ b/hacs.json @@ -1,6 +1,6 @@ { "name": "GivEnergy Local", "hacs": "1.6.0", - "homeassistant": "2023.1.0", + "homeassistant": "2023.10.0", "render_readme": true } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 05241d2..1ddb962 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,8 @@ -aiofiles==0.8.0 -arrow==1.2.3 -crccheck==1.3.0 -pydantic==1.10.15 -aenum==3.1.12 +crccheck~=1.3 + +# HA 2023.10 was pinned to 1.10.12 +# pydantic v2 is known to have breaking changes +pydantic>=1.10.12,<2 + +# Don't pin the HA version homeassistant