diff --git a/pkgs/development/python-modules/lg-rs232-tv/default.nix b/pkgs/development/python-modules/lg-rs232-tv/default.nix new file mode 100644 index 000000000000..0b259670027d --- /dev/null +++ b/pkgs/development/python-modules/lg-rs232-tv/default.nix @@ -0,0 +1,54 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + uv-build, + serialx, + aiowebostv, + pytest-asyncio, + pytest-timeout, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "lg-rs232-tv"; + version = "1.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "home-assistant-libs"; + repo = "lg-rs232-tv"; + tag = finalAttrs.version; + hash = "sha256-gMjRyZ/gUMAsS0v465ISD38YAlrOB8N/5VAFZkXtyAE="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "uv_build>=0.8.4,<0.9.0" "uv_build" + ''; + + build-system = [ uv-build ]; + + dependencies = [ serialx ]; + + optional-dependencies = { + esphome = serialx.optional-dependencies.esphome; + remote = [ aiowebostv ]; + }; + + nativeCheckInputs = [ + pytest-asyncio + pytest-timeout + pytestCheckHook + ]; + + pythonImportsCheck = [ "lg_rs232_tv" ]; + + meta = { + description = "Async library to control LG TVs over RS232"; + homepage = "https://github.com/home-assistant-libs/lg-rs232-tv"; + changelog = "https://github.com/home-assistant-libs/lg-rs232-tv/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.jamiemagee ]; + }; +}) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 5f244f47270b..5e1fb487e78b 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -3613,8 +3613,9 @@ "lg_tv_rs232" = ps: with ps; [ aiousbwatcher + lg-rs232-tv serialx - ]; # missing inputs: lg-rs232-tv + ]; "libre_hardware_monitor" = ps: with ps; [ librehardwaremonitor-api @@ -8234,6 +8235,7 @@ "lg_netcast" "lg_soundbar" "lg_thinq" + "lg_tv_rs232" "libre_hardware_monitor" "lichess" "lidarr" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 984026690e5e..168f7e253263 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8788,6 +8788,8 @@ self: super: with self; { lexilang = callPackage ../development/python-modules/lexilang { }; + lg-rs232-tv = callPackage ../development/python-modules/lg-rs232-tv { }; + lgpio = toPythonModule ( pkgs.lgpio.override { inherit buildPythonPackage;