diff --git a/pkgs/development/python-modules/pymitsubishi/default.nix b/pkgs/development/python-modules/pymitsubishi/default.nix new file mode 100644 index 000000000000..fc553fe5461e --- /dev/null +++ b/pkgs/development/python-modules/pymitsubishi/default.nix @@ -0,0 +1,41 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + requests, + pycryptodome, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "pymitsubishi"; + version = "0.1.7"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pymitsubishi"; + repo = "pymitsubishi"; + tag = "v${version}"; + hash = "sha256-tEmhllXvUwiJG1q7MyBrHPVVxzcZYgzTHzD8jnqfXvA="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + requests + pycryptodome + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "pymitsubishi" ]; + + meta = { + description = "A Python library for controlling and monitoring Mitsubishi MAC-577IF-2E air conditioners"; + homepage = "https://github.com/pymitsubishi/pymitsubishi"; + changelog = "https://github.com/pymitsubishi/pymitsubishi/releases/tag/${src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ uvnikita ]; + }; +} diff --git a/pkgs/servers/home-assistant/custom-components/mitsubishi/package.nix b/pkgs/servers/home-assistant/custom-components/mitsubishi/package.nix new file mode 100644 index 000000000000..9ceb7a1c87da --- /dev/null +++ b/pkgs/servers/home-assistant/custom-components/mitsubishi/package.nix @@ -0,0 +1,40 @@ +{ + lib, + fetchFromGitHub, + buildHomeAssistantComponent, + pymitsubishi, + pytest-cov-stub, + pytestCheckHook, + pytest-homeassistant-custom-component, +}: + +buildHomeAssistantComponent rec { + owner = "pymitsubishi"; + domain = "mitsubishi"; + version = "0.1.4"; + + src = fetchFromGitHub { + owner = "pymitsubishi"; + repo = "homeassistant-mitsubishi"; + tag = "v${version}"; + hash = "sha256-cJBhIck33gyFTITQKlLZSdKDA3VXeVJFGcQoD49BgWQ="; + }; + + dependencies = [ + pymitsubishi + ]; + + nativeCheckInputs = [ + pytest-cov-stub + pytestCheckHook + pytest-homeassistant-custom-component + ]; + + meta = with lib; { + description = "Home Assistant Mitsubishi Air Conditioner Integration"; + changelog = "https://github.com/pymitsubishi/homeassistant-mitsubishi/releases/tag/v${version}"; + homepage = "https://github.com/pymitsubishi/homeassistant-mitsubishi"; + maintainers = with maintainers; [ uvnikita ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d6f0da38edec..d4ab7a2dff14 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13258,6 +13258,8 @@ self: super: with self; { pymilvus = callPackage ../development/python-modules/pymilvus { }; + pymitsubishi = callPackage ../development/python-modules/pymitsubishi { }; + pymitv = callPackage ../development/python-modules/pymitv { }; pymodbus = callPackage ../development/python-modules/pymodbus { };