diff --git a/pkgs/development/python-modules/tilt-ble/default.nix b/pkgs/development/python-modules/tilt-ble/default.nix new file mode 100644 index 000000000000..e7fd0e0368b9 --- /dev/null +++ b/pkgs/development/python-modules/tilt-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 = "tilt-ble"; + version = "0.2.2"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "Bluetooth-Devices"; + repo = pname; + rev = "v${version}"; + hash = "sha256-inr2cPl627w2klSqScMg3dvofIkX3hGb44+Go6ah/6I="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + bluetooth-sensor-state-data + home-assistant-bluetooth + sensor-state-data + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --cov=tilt_ble --cov-report=term-missing:skip-covered" "" + ''; + + pythonImportsCheck = [ + "tilt_ble" + ]; + + meta = with lib; { + description = "Library for Tilt BLE devices"; + homepage = "https://github.com/Bluetooth-Devices/tilt-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 34c13bd026df..dd5a5b47a107 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10894,6 +10894,8 @@ in { tilestache = callPackage ../development/python-modules/tilestache { }; + tilt-ble = callPackage ../development/python-modules/tilt-ble { }; + timeago = callPackage ../development/python-modules/timeago { }; timecop = callPackage ../development/python-modules/timecop { };