2022-08-21 13:32:41 +00:00
|
|
|
{ lib
|
2022-09-09 14:08:57 +00:00
|
|
|
, bluetooth-data-tools
|
2022-08-21 13:32:41 +00:00
|
|
|
, bluetooth-sensor-state-data
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
|
|
|
, pycryptodomex
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2023-07-15 17:15:38 +00:00
|
|
|
, pytz
|
2022-08-21 13:32:41 +00:00
|
|
|
, sensor-state-data
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bthome-ble";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.12.0";
|
2022-08-21 13:32:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Bluetooth-Devices";
|
|
|
|
repo = pname;
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-SonB0pT6sC6kpFmIMzNeASUHyuik4HOOquWx6+K05Y8=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-09-09 14:08:57 +00:00
|
|
|
bluetooth-data-tools
|
2022-08-21 13:32:41 +00:00
|
|
|
bluetooth-sensor-state-data
|
|
|
|
sensor-state-data
|
|
|
|
pycryptodomex
|
2023-07-15 17:15:38 +00:00
|
|
|
pytz
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-21 13:32:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace " --cov=bthome_ble --cov-report=term-missing:skip-covered" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"bthome_ble"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for BThome BLE devices";
|
|
|
|
homepage = "https://github.com/Bluetooth-Devices/bthome-ble";
|
2022-11-21 17:40:18 +00:00
|
|
|
changelog = "https://github.com/bluetooth-devices/bthome-ble/blob/v${version}/CHANGELOG.md";
|
2022-08-21 13:32:41 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|