diff --git a/pkgs/development/python-modules/sensorpush-ble/default.nix b/pkgs/development/python-modules/sensorpush-ble/default.nix new file mode 100644 index 000000000000..80fcbfa17694 --- /dev/null +++ b/pkgs/development/python-modules/sensorpush-ble/default.nix @@ -0,0 +1,55 @@ +{ lib +, bluetooth-sensor-state-data +, buildPythonPackage +, fetchFromGitHub +, home-assistant-bluetooth +, poetry-core +, pytestCheckHook +, pythonOlder +, sensor-state-data +}: + +buildPythonPackage rec { + pname = "sensorpush-ble"; + version = "1.5.1"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "Bluetooth-Devices"; + repo = pname; + rev = "v${version}"; + hash = "sha256-2Q56fXMgw1Al3l6WKI1cdGXfLmZ1qkidkoWKmvEXRaI="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + bluetooth-sensor-state-data + home-assistant-bluetooth + sensor-state-data + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --cov=sensorpush_ble --cov-report=term-missing:skip-covered" "" + ''; + + pythonImportsCheck = [ + "sensorpush_ble" + ]; + + meta = with lib; { + description = "Library for SensorPush BLE devices"; + homepage = "https://github.com/Bluetooth-Devices/sensorpush-ble"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 814cb54a4c0e..387eb6d058e5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9727,6 +9727,8 @@ in { sensor-state-data = callPackage ../development/python-modules/sensor-state-data { }; + sensorpush-ble = callPackage ../development/python-modules/sensorpush-ble { }; + sentencepiece = callPackage ../development/python-modules/sentencepiece { inherit (pkgs) sentencepiece; };