summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2019-10-30 08:01:44 +0100
committerJeschli <jeschli@gmail.com>2019-11-14 15:36:11 +0100
commit2ac3254bd9dd4357c4c3d2880f7a127d3ff9d77c (patch)
treecb307726229766667b7c97c78b9087e08f7a6ebd
parent3f5b67e68c1a78ef9f3c3c6499e48b4e00dc6c66 (diff)
ma bureautomation: fix all the regression, add openwrt-luci-rpc as dependency
-rw-r--r--makefu/2configs/bureautomation/default.nix9
-rw-r--r--makefu/2configs/bureautomation/deps/gtts-token.nix27
-rw-r--r--makefu/2configs/bureautomation/deps/openwrt-luci-rpc.nix34
-rw-r--r--makefu/2configs/bureautomation/deps/pyhaversion.nix33
-rw-r--r--makefu/2configs/bureautomation/device_tracker/openwrt.nix1
-rw-r--r--makefu/2configs/bureautomation/light/statuslight.nix8
-rw-r--r--makefu/2configs/bureautomation/sensor/pollen.nix2
7 files changed, 44 insertions, 70 deletions
diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix
index 9492f6ac2..e07e0ddf0 100644
--- a/makefu/2configs/bureautomation/default.nix
+++ b/makefu/2configs/bureautomation/default.nix
@@ -33,7 +33,7 @@ in {
extraPackages = ps: with ps; [
pkgs.pico2wave
python-forecastio jsonrpc-async jsonrpc-websocket mpd2
- (callPackage ./deps/gtts-token.nix { })
+ (callPackage ./deps/openwrt-luci-rpc.nix { })
];
};
autoExtraComponents = true;
@@ -46,7 +46,9 @@ in {
elevation = 303;
auth_providers = [
{ type = "homeassistant";}
- # { type = "legacy_api_password";}
+ { type = "legacy_api_password";
+ api_password = "sistemas";
+ }
{ type = "trusted_networks";
trusted_networks = [
"127.0.0.1/32"
@@ -124,7 +126,7 @@ in {
aramark.binary_sensor;
sensor =
- [{ platform = "version"; }] ++
+ # [{ platform = "version"; }] ++ # pyhaversion
(import ./sensor/pollen.nix) ++
(import ./sensor/espeasy.nix) ++
(import ./sensor/airquality.nix) ++
@@ -145,7 +147,6 @@ in {
http = {
# TODO: https://github.com/home-assistant/home-assistant/issues/16149
base_url = "http://192.168.8.11:8123";
- api_password = "sistemas";
};
conversation = {};
history = {};
diff --git a/makefu/2configs/bureautomation/deps/gtts-token.nix b/makefu/2configs/bureautomation/deps/gtts-token.nix
deleted file mode 100644
index 69640f03d..000000000
--- a/makefu/2configs/bureautomation/deps/gtts-token.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, requests
-}:
-
-buildPythonPackage rec {
- pname = "gtts-token";
- version = "1.1.3";
-
- src = fetchPypi {
- pname = "gTTS-token";
- inherit version;
- sha256 = "9d6819a85b813f235397ef931ad4b680f03d843c9b2a9e74dd95175a4bc012c5";
- };
-
- propagatedBuildInputs = [
- requests
- ];
-
- meta = with lib; {
- description = "Calculates a token to run the Google Translate text to speech";
- homepage = https://github.com/boudewijn26/gTTS-token;
- license = licenses.mit;
- # maintainers = [ maintainers. ];
- };
-}
diff --git a/makefu/2configs/bureautomation/deps/openwrt-luci-rpc.nix b/makefu/2configs/bureautomation/deps/openwrt-luci-rpc.nix
new file mode 100644
index 000000000..4eceeb146
--- /dev/null
+++ b/makefu/2configs/bureautomation/deps/openwrt-luci-rpc.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, click
+, requests
+, packaging
+}:
+
+buildPythonPackage rec {
+ pname = "openwrt-luci-rpc";
+ version = "1.1.2";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "174a1f6c0bb2a2ed76e5299d14e2be05c612e8bcd4c15b9a9aedee1ef8e18b90";
+ };
+
+ patchPhase = ''
+ sed -i -e "s/requests==2.21.0/requests/" -e "s/packaging==19.1/packaging/" setup.py
+ '';
+
+ propagatedBuildInputs = [
+ click
+ requests
+ packaging
+ ];
+
+ meta = with lib; {
+ description = "Module for interacting with OpenWrt Luci RPC interface";
+ homepage = https://github.com/fbradyirl/openwrt-luci-rpc;
+ license = licenses.asl20;
+ maintainers = [ maintainers.makefu ];
+ };
+}
diff --git a/makefu/2configs/bureautomation/deps/pyhaversion.nix b/makefu/2configs/bureautomation/deps/pyhaversion.nix
deleted file mode 100644
index a75c6a976..000000000
--- a/makefu/2configs/bureautomation/deps/pyhaversion.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchpatch
-, fetchPypi
-, aiohttp
-, async-timeout
-}:
-
-buildPythonPackage rec {
- pname = "pyhaversion";
- version = "2.2.1";
-
- src = fetchPypi {
- inherit pname version;
- sha256 = "72b65aa25d7b2dbb839a4d0218df2005c2335e93526035904d365bb668030b9f";
- };
- patches = [
- (fetchpatch { url = "https://github.com/makefu/pyhaversion/commit/f3bdc38970272cd345c2cfbde3037ea492ca27c4.patch";
- sha256 =
- "1rhq4z7mdgnwhwpf5fmarnbc1ba3qysk1wqjdr0hvbzi8vmvbfcc";})
- ];
- doCheck = false;
- propagatedBuildInputs = [
- aiohttp
- async-timeout
- ];
-
- meta = with lib; {
- description = "";
- homepage = https://github.com/ludeeus/pyhaversion;
- # maintainers = [ maintainers. ];
- };
-}
diff --git a/makefu/2configs/bureautomation/device_tracker/openwrt.nix b/makefu/2configs/bureautomation/device_tracker/openwrt.nix
index d32eab60f..5de216474 100644
--- a/makefu/2configs/bureautomation/device_tracker/openwrt.nix
+++ b/makefu/2configs/bureautomation/device_tracker/openwrt.nix
@@ -3,7 +3,6 @@
[
{ platform = "luci";
- name = "router";
host = "192.168.8.1";
username = "root";
password = import <secrets/hass/router.nix>;
diff --git a/makefu/2configs/bureautomation/light/statuslight.nix b/makefu/2configs/bureautomation/light/statuslight.nix
index 31f52f492..c9d301758 100644
--- a/makefu/2configs/bureautomation/light/statuslight.nix
+++ b/makefu/2configs/bureautomation/light/statuslight.nix
@@ -24,13 +24,13 @@ let
brightness_command_topic = "/bam/${topic}/cmnd/Dimmer";
brightness_scale = 100;
# color
- rgb_state_topic = "/bam/${topic}/stat/Color";
+ rgb_state_topic = "/bam/${topic}/stat/RESULT";
rgb_command_topic = "/bam/${topic}/cmnd/Color2";
- rgb_command_mode = "hex";
- rgb_command_template = "{{ '%02x%02x%02x' | format(red, green, blue)}}";
+ rgb_value_template = "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}";
+
# effects
effect_state_topic = "/bam/${topic}/tele/STATE";
- effects_value_template = "{{value_json.Scheme|default(0)}}";
+ effect_value_template = "{{value_json.Scheme|default(0)}}";
effect_command_topic = "/bam/${topic}/cmnd/Scheme";
effect_list = [
0 # single color for LED light
diff --git a/makefu/2configs/bureautomation/sensor/pollen.nix b/makefu/2configs/bureautomation/sensor/pollen.nix
index 506dbf123..8ddb49e58 100644
--- a/makefu/2configs/bureautomation/sensor/pollen.nix
+++ b/makefu/2configs/bureautomation/sensor/pollen.nix
@@ -1,6 +1,6 @@
[ {
platform = "dwd_pollen";
- partsregion_ids = [
+ partregion_ids = [
112
];
}