2021-01-25 09:26:54 +01:00
|
|
|
{ lib
|
2020-01-01 13:24:24 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, appdirs
|
|
|
|
, click
|
|
|
|
, construct
|
2020-10-30 21:30:32 +01:00
|
|
|
, croniter
|
2020-01-01 13:24:24 +01:00
|
|
|
, cryptography
|
2020-10-30 21:30:32 +01:00
|
|
|
, importlib-metadata
|
2020-01-01 13:24:24 +01:00
|
|
|
, pytest
|
2020-10-30 21:30:32 +01:00
|
|
|
, pytest-mock
|
2020-01-01 13:24:24 +01:00
|
|
|
, zeroconf
|
|
|
|
, attrs
|
|
|
|
, pytz
|
|
|
|
, tqdm
|
|
|
|
, netifaces
|
|
|
|
}:
|
|
|
|
|
2020-10-30 21:30:32 +01:00
|
|
|
|
2020-01-01 13:24:24 +01:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-miio";
|
2020-11-29 15:04:40 +01:00
|
|
|
version = "0.5.4";
|
2020-01-01 13:24:24 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-11-29 15:04:40 +01:00
|
|
|
sha256 = "5a6fd3bb2cc2f75cdfe5673f36a5a418144d08add6e53b384cb146e99f27bd39";
|
2020-01-01 13:24:24 +01:00
|
|
|
};
|
|
|
|
|
2020-10-30 21:30:32 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "zeroconf>=0.25.1,<0.26.0" "zeroconf"
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "pytz>=2019.3,<2020.0" "pytz"
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "cryptography>=2.9,<3.0" "cryptography"
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ pytest pytest-mock];
|
|
|
|
propagatedBuildInputs = [ appdirs click construct croniter cryptography importlib-metadata zeroconf attrs pytz tqdm netifaces ];
|
2020-01-01 13:24:24 +01:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
pytest
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-01-01 13:24:24 +01:00
|
|
|
description = "Python library for interfacing with Xiaomi smart appliances";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/rytilahti/python-miio";
|
2020-01-01 13:24:24 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ flyfloh ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|