diff --git a/pkgs/development/python-modules/pymodbus/default.nix b/pkgs/development/python-modules/pymodbus/default.nix new file mode 100644 index 00000000000..76f2e9a9338 --- /dev/null +++ b/pkgs/development/python-modules/pymodbus/default.nix @@ -0,0 +1,59 @@ +{ lib +, asynctest +, buildPythonPackage +, fetchFromGitHub +, mock +, pyserial +, pyserial-asyncio +, pytestCheckHook +, pythonOlder +, redis +, sqlalchemy +, tornado +, twisted +}: + +buildPythonPackage rec { + pname = "pymodbus"; + version = "2.4.0"; + + src = fetchFromGitHub { + owner = "riptideio"; + repo = pname; + rev = "v${version}"; + sha256 = "0x0dv02shcc2yxxm9kvcbhip111sna74dvcfssxdzzy967vnq76v"; + }; + + # Twisted asynchronous version is not supported due to a missing dependency + propagatedBuildInputs = [ + pyserial + pyserial-asyncio + tornado + ]; + + checkInputs = [ + asynctest + mock + pyserial-asyncio + pytestCheckHook + redis + sqlalchemy + tornado + twisted + ]; + + pythonImportsCheck = [ "pymodbus" ]; + + meta = with lib; { + description = "Python implementation of the Modbus protocol"; + longDescription = '' + Pymodbus is a full Modbus protocol implementation using twisted, + torndo or asyncio for its asynchronous communications core. It can + also be used without any third party dependencies if a more + lightweight project is needed. + ''; + homepage = "https://github.com/riptideio/pymodbus"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index e7fd1dee772..8551ed5f842 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -258,7 +258,7 @@ "fitbit" = ps: with ps; [ aiohttp-cors fitbit ]; "fixer" = ps: with ps; [ ]; # missing inputs: fixerio "fleetgo" = ps: with ps; [ ]; # missing inputs: ritassist - "flexit" = ps: with ps; [ ]; # missing inputs: pyflexit pymodbus + "flexit" = ps: with ps; [ pymodbus ]; # missing inputs: pyflexit "flic" = ps: with ps; [ ]; # missing inputs: pyflic-homeassistant "flick_electric" = ps: with ps; [ ]; # missing inputs: PyFlick "flo" = ps: with ps; [ ]; # missing inputs: aioflo @@ -503,7 +503,7 @@ "mjpeg" = ps: with ps; [ ]; "mobile_app" = ps: with ps; [ pynacl aiohttp-cors emoji hass-nabucasa pillow ]; "mochad" = ps: with ps; [ ]; # missing inputs: pymochad - "modbus" = ps: with ps; [ ]; # missing inputs: pymodbus + "modbus" = ps: with ps; [ pymodbus ]; "modem_callerid" = ps: with ps; [ ]; # missing inputs: basicmodem "mold_indicator" = ps: with ps; [ ]; "monoprice" = ps: with ps; [ ]; # missing inputs: pymonoprice @@ -785,7 +785,7 @@ "statistics" = ps: with ps; [ sqlalchemy ]; "statsd" = ps: with ps; [ statsd ]; "steam_online" = ps: with ps; [ ]; # missing inputs: steamodd - "stiebel_eltron" = ps: with ps; [ ]; # missing inputs: pymodbus pystiebeleltron + "stiebel_eltron" = ps: with ps; [ pymodbus ]; # missing inputs: pystiebeleltron "stookalert" = ps: with ps; [ ]; # missing inputs: stookalert "stream" = ps: with ps; [ aiohttp-cors av ]; "streamlabswater" = ps: with ps; [ ]; # missing inputs: streamlabswater diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5120035d3c9..ffaaa5a3b96 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5437,6 +5437,8 @@ in { pymetno = callPackage ../development/python-modules/pymetno { }; + pymodbus = callPackage ../development/python-modules/pymodbus { }; + pymongo = callPackage ../development/python-modules/pymongo { }; pympler = callPackage ../development/python-modules/pympler { };