diff --git a/pkgs/development/python-modules/bme280spi/default.nix b/pkgs/development/python-modules/bme280spi/default.nix new file mode 100644 index 000000000000..a7a1e0fb920e --- /dev/null +++ b/pkgs/development/python-modules/bme280spi/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, spidev +}: + +buildPythonPackage rec { + pname = "bme280spi"; + version = "0.2.0"; + + disabled = pythonOlder "3.8"; + + src = fetchPypi { + inherit pname version; + sha256 = "51682acefda6f29eaaf9f37815edbfdd48ef0e9f1509419eceafe7b440eddc6e"; + }; + + propagatedBuildInputs = [ + spidev + ]; + + # no tests implemented + doCheck = false; + + meta = with lib; { + description = "Library for BME280 sensor through spidev"; + homepage = "https://github.com/Kuzj/bme280spi"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/i2csense/default.nix b/pkgs/development/python-modules/i2csense/default.nix new file mode 100644 index 000000000000..475e77c21841 --- /dev/null +++ b/pkgs/development/python-modules/i2csense/default.nix @@ -0,0 +1,35 @@ +{ lib +, buildPythonPackage +, fetchPypi +, smbus-cffi +}: + +buildPythonPackage rec { + pname = "i2csense"; + version = "0.0.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "6f9c0a37d971e5b8a60c54982bd580cff84bf94fedc08c097e603a8e5609c33f"; + }; + + propagatedBuildInputs = [ + smbus-cffi + ]; + + # no tests implemented + doCheck = false; + + pythonImportsCheck = [ + "i2csense.bme280" + "i2csense.bh1750" + "i2csense.htu21d" + ]; + + meta = with lib; { + description = "A library to handle i2c sensors with the Raspberry Pi"; + homepage = "https://github.com/azogue/i2csense"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index c7aeb4253106..03138da199de 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -83,7 +83,7 @@ "bbb_gpio" = ps: with ps; [ ]; # missing inputs: Adafruit_BBIO "bbox" = ps: with ps; [ ]; # missing inputs: pybbox "beewi_smartclim" = ps: with ps; [ ]; # missing inputs: beewi_smartclim - "bh1750" = ps: with ps; [ smbus-cffi ]; # missing inputs: i2csense + "bh1750" = ps: with ps; [ i2csense smbus-cffi ]; "binary_sensor" = ps: with ps; [ ]; "bitcoin" = ps: with ps; [ blockchain ]; "bizkaibus" = ps: with ps; [ bizkaibus ]; @@ -98,7 +98,7 @@ "bluesound" = ps: with ps; [ xmltodict ]; "bluetooth_le_tracker" = ps: with ps; [ pygatt ]; "bluetooth_tracker" = ps: with ps; [ bt-proximity pybluez ]; - "bme280" = ps: with ps; [ smbus-cffi ]; # missing inputs: bme280spi i2csense + "bme280" = ps: with ps; [ bme280spi i2csense smbus-cffi ]; "bme680" = ps: with ps; [ bme680 smbus-cffi ]; "bmp280" = ps: with ps; [ ]; # missing inputs: RPi.GPIO adafruit-circuitpython-bmp280 "bmw_connected_drive" = ps: with ps; [ bimmer-connected ]; @@ -382,7 +382,7 @@ "hp_ilo" = ps: with ps; [ python-hpilo ]; "html5" = ps: with ps; [ aiohttp-cors pywebpush ]; "http" = ps: with ps; [ aiohttp-cors ]; - "htu21d" = ps: with ps; [ smbus-cffi ]; # missing inputs: i2csense + "htu21d" = ps: with ps; [ i2csense smbus-cffi ]; "huawei_lte" = ps: with ps; [ huawei-lte-api stringcase url-normalize ]; "hue" = ps: with ps; [ aiohue ]; "huisbaasje" = ps: with ps; [ huisbaasje-client ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7d8c0c20c42b..260bc92d5bb9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1280,6 +1280,8 @@ in { blurhash = callPackage ../development/python-modules/blurhash { }; + bme280spi = callPackage ../development/python-modules/bme280spi { }; + bme680 = callPackage ../development/python-modules/bme680 { }; bokeh = callPackage ../development/python-modules/bokeh { }; @@ -3876,6 +3878,8 @@ in { inherit (pkgs) i2c-tools; }; + i2csense = callPackage ../development/python-modules/i2csense { }; + i3ipc = callPackage ../development/python-modules/i3ipc { }; i3-py = callPackage ../development/python-modules/i3-py { };