From 1554911a91e981e37334532c4b00356a00af63c6 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Fri, 4 Sep 2026 23:24:43 -0700 Subject: [PATCH 1/2] python3Packages.sofar-modbus: init at 0.5.0 --- .../python-modules/sofar-modbus/default.nix | 53 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 55 insertions(+) create mode 100644 pkgs/development/python-modules/sofar-modbus/default.nix diff --git a/pkgs/development/python-modules/sofar-modbus/default.nix b/pkgs/development/python-modules/sofar-modbus/default.nix new file mode 100644 index 000000000000..8b64ece285f4 --- /dev/null +++ b/pkgs/development/python-modules/sofar-modbus/default.nix @@ -0,0 +1,53 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + modbus-connection, + pyprojectVersionPatchHook, + pytest-asyncio, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "sofar-modbus"; + version = "0.5.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "darkrain-nl"; + repo = "sofar-modbus"; + tag = finalAttrs.version; + hash = "sha256-rigrnxn/eHu98S0RHDdJXs7zx5RovCpQnsvqUCkY0yo="; + }; + + nativeBuildInputs = [ + pyprojectVersionPatchHook + ]; + + build-system = [ + hatchling + ]; + + dependencies = [ + modbus-connection + ] + ++ modbus-connection.optional-dependencies.tmodbus; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ + "sofar_modbus" + ]; + + meta = { + description = "Read Sofar Solar inverters over Modbus"; + homepage = "https://github.com/darkrain-nl/sofar-modbus"; + changelog = "https://github.com/darkrain-nl/sofar-modbus/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.jamiemagee ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c08adde847c4..930b7356921f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19290,6 +19290,8 @@ self: super: with self; { soco = callPackage ../development/python-modules/soco { }; + sofar-modbus = callPackage ../development/python-modules/sofar-modbus { }; + softlayer = callPackage ../development/python-modules/softlayer { }; solaredge-local = callPackage ../development/python-modules/solaredge-local { }; From 84b4f33191f79fb655f8532601184db02d1fc1dd Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Fri, 4 Sep 2026 23:24:48 -0700 Subject: [PATCH 2/2] home-assistant: update component packages --- pkgs/servers/home-assistant/component-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 4fa0fa04b601..3a295dd19025 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -6685,9 +6685,10 @@ [ modbus-connection pymodbus + sofar-modbus tmodbus ] - ++ modbus-connection.optional-dependencies.tmodbus; # missing inputs: sofar-modbus + ++ modbus-connection.optional-dependencies.tmodbus; "solaredge" = ps: with ps; [ aiosolaredge @@ -9237,6 +9238,7 @@ "snmp" "snoo" "snooz" + "sofar" "solaredge" "solarlog" "solarman"