Merge pull request #127281 from dotlambda/eebrightbox-init

home-assistant: support ee_brightbox component
This commit is contained in:
Fabian Affolter 2021-06-18 09:22:52 +02:00 committed by GitHub
commit c67ec6ddea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 126 additions and 1 deletions

View File

@ -0,0 +1,49 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools
, ply
, python
}:
buildPythonPackage rec {
pname = "calmjs-parse";
version = "1.2.5";
src = fetchFromGitHub {
owner = "calmjs";
repo = "calmjs.parse";
rev = version;
sha256 = "0ypfbas33k1706p6w1bf9gnrv38z8fa4qci1iaks80dp58g8sv4r";
};
propagatedBuildInputs = [
setuptools
ply
];
checkPhase = ''
runHook preCheck
${python.interpreter} -m unittest calmjs.parse.tests.make_suite
runHook postCheck
'';
pythonImportsCheck = [
"calmjs.parse"
"calmjs.parse.asttypes"
"calmjs.parse.parsers"
"calmjs.parse.rules"
"calmjs.parse.sourcemap"
"calmjs.parse.unparsers.es5"
"calmjs.parse.walkers"
];
meta = with lib; {
description = "Various parsers for ECMA standards";
homepage = "https://github.com/calmjs/calmjs.parse";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}

View File

@ -0,0 +1,58 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pbr
, calmjs-parse
, certifi
, chardet
, idna
, ply
, requests
, urllib3
, httpretty
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "eebrightbox";
version = "0.0.6";
src = fetchFromGitHub {
owner = "krygal";
repo = "eebrightbox";
rev = version;
sha256 = "1kms240g01871qbvyc5rzf86yxsrlnfvp323jh4k35fpf45z44rr";
};
postPatch = ''
substituteInPlace requirements.txt --replace "==" ">="
'';
nativeBuildInputs = [
pbr
];
PBR_VERSION = version;
propagatedBuildInputs = [
calmjs-parse
certifi
chardet
idna
ply
requests
urllib3
];
checkInputs = [
httpretty
pytestCheckHook
];
meta = with lib; {
description = "Connector for EE BrightBox routers";
homepage = "https://github.com/krygal/eebrightbox";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}

View File

@ -209,7 +209,7 @@
"eddystone_temperature" = ps: with ps; [ construct ]; # missing inputs: beacontools[scan]
"edimax" = ps: with ps; [ pyedimax ];
"edl21" = ps: with ps; [ ]; # missing inputs: pysml
"ee_brightbox" = ps: with ps; [ ]; # missing inputs: eebrightbox
"ee_brightbox" = ps: with ps; [ eebrightbox ];
"efergy" = ps: with ps; [ ];
"egardia" = ps: with ps; [ pythonegardia ];
"eight_sleep" = ps: with ps; [ pyeight ];

View File

@ -134,6 +134,19 @@ let
});
})
# Pinned due to API changes in eebrightbox>=0.0.5
(self: super: {
eebrightbox = super.eebrightbox.overridePythonAttrs (oldAttrs: rec {
version = "0.0.4";
src = fetchFromGitHub {
owner = "krygal";
repo = "eebrightbox";
rev = version;
sha256 = "0d8mmpwgrd7gymw5263r1v2wjv6dx6w6pq13d62fkfm4h2hya4a4";
};
});
})
# home-assistant-frontend does not exist in python3.pkgs
(self: super: {
home-assistant-frontend = self.callPackage ./frontend.nix { };
@ -352,6 +365,7 @@ in with py.pkgs; buildPythonApplication rec {
"eafm"
"ecobee"
"econet"
"ee_brightbox"
"efergy"
"emonitor"
"emulated_hue"

View File

@ -1277,6 +1277,8 @@ in {
caldav = callPackage ../development/python-modules/caldav { };
calmjs-parse = callPackage ../development/python-modules/calmjs-parse { };
can = callPackage ../development/python-modules/can { };
canmatrix = callPackage ../development/python-modules/canmatrix { };
@ -2229,6 +2231,8 @@ in {
edward = callPackage ../development/python-modules/edward { };
eebrightbox = callPackage ../development/python-modules/eebrightbox { };
effect = callPackage ../development/python-modules/effect { };
eggdeps = callPackage ../development/python-modules/eggdeps { };