2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
bleak,
|
|
|
|
bleak-retry-connector,
|
|
|
|
bluetooth-data-tools,
|
|
|
|
bluetooth-sensor-state-data,
|
|
|
|
buildPythonPackage,
|
|
|
|
cryptography,
|
|
|
|
fetchFromGitHub,
|
|
|
|
home-assistant-bluetooth,
|
|
|
|
poetry-core,
|
|
|
|
pycryptodomex,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
sensor-state-data,
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "xiaomi-ble";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.29.0";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Bluetooth-Devices";
|
2024-02-29 20:09:43 +00:00
|
|
|
repo = "xiaomi-ble";
|
2022-12-17 10:02:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-+zMjnLUzI8ctucvxXts7V4lN4Gp0ZQtArhpXUCBvhF0=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-02-29 20:09:43 +00:00
|
|
|
--replace-fail " --cov=xiaomi_ble --cov-report=term-missing:skip-covered" ""
|
2023-08-04 22:07:22 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [ poetry-core ];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [ "pycryptodomex" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2023-08-04 22:07:22 +00:00
|
|
|
bleak
|
2022-08-12 12:06:08 +00:00
|
|
|
bleak-retry-connector
|
2022-09-11 15:47:08 +00:00
|
|
|
bluetooth-data-tools
|
2022-08-12 12:06:08 +00:00
|
|
|
bluetooth-sensor-state-data
|
2023-08-04 22:07:22 +00:00
|
|
|
cryptography
|
2022-08-12 12:06:08 +00:00
|
|
|
home-assistant-bluetooth
|
|
|
|
pycryptodomex
|
|
|
|
sensor-state-data
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pythonImportsCheck = [ "xiaomi_ble" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for Xiaomi BLE devices";
|
|
|
|
homepage = "https://github.com/Bluetooth-Devices/xiaomi-ble";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/Bluetooth-Devices/xiaomi-ble/releases/tag/v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|