summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/ham
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-04-22 00:36:07 +0200
committermakefu <github@syntax-fehler.de>2020-04-22 00:36:07 +0200
commit2b33dd262f1cb934b41c23ec9bed47aaa76ba7b8 (patch)
tree913b945361455ae957335a51ae4d5707e773c2a6 /makefu/2configs/ham
parent49f06e6d91c34482e495a84b32ec2f961b5db024 (diff)
parentc96504d9a0f8f9f5c80c9630906c177ff3667e55 (diff)
Merge branch 'master' into 20.03
Diffstat (limited to 'makefu/2configs/ham')
-rw-r--r--makefu/2configs/ham/androidtv/adbshell.nix4
-rw-r--r--makefu/2configs/ham/androidtv/default.nix4
-rw-r--r--makefu/2configs/ham/androidtv/purepythonadb.nix6
-rw-r--r--makefu/2configs/ham/default.nix3
-rw-r--r--makefu/2configs/ham/multi/the_playlist.nix57
5 files changed, 67 insertions, 7 deletions
diff --git a/makefu/2configs/ham/androidtv/adbshell.nix b/makefu/2configs/ham/androidtv/adbshell.nix
index f5b96c859..0fadeeb05 100644
--- a/makefu/2configs/ham/androidtv/adbshell.nix
+++ b/makefu/2configs/ham/androidtv/adbshell.nix
@@ -9,11 +9,11 @@
buildPythonPackage rec {
pname = "adb_shell";
- version = "0.0.8";
+ version = "0.1.1";
src = fetchPypi {
inherit pname version;
- sha256 = "01f9jinhfyjldg9793gz2i7gcd9xyx0a62r7a5ijssklcnn2rwnm";
+ sha256 = "0a4mjrnw2lrhsakb1vjb5l6m3cr1ii7fibs7020nwv08cyx6pq6q";
};
propagatedBuildInputs = [
diff --git a/makefu/2configs/ham/androidtv/default.nix b/makefu/2configs/ham/androidtv/default.nix
index 8f3bdc1f3..b7d397db4 100644
--- a/makefu/2configs/ham/androidtv/default.nix
+++ b/makefu/2configs/ham/androidtv/default.nix
@@ -6,11 +6,11 @@
buildPythonPackage rec {
pname = "androidtv";
- version = "0.0.34";
+ version = "0.0.38";
src = fetchPypi {
inherit pname version;
- sha256 = "13078i2a9hglpv4ldycph5n5485np21vs6z2qn830hybmx8kfxsw";
+ sha256 = "0ri1fnc63zashc667w2mlpb0c7ri3x6wnhnf54klb89v73pdnb8k";
};
propagatedBuildInputs = [
diff --git a/makefu/2configs/ham/androidtv/purepythonadb.nix b/makefu/2configs/ham/androidtv/purepythonadb.nix
index d4e763b70..c9b1ff5e8 100644
--- a/makefu/2configs/ham/androidtv/purepythonadb.nix
+++ b/makefu/2configs/ham/androidtv/purepythonadb.nix
@@ -5,11 +5,11 @@
buildPythonPackage rec {
pname = "pure-python-adb";
- version = "0.2.3.dev0";
+ version = "0.2.2.dev0";
src = fetchPypi {
inherit pname version;
- sha256 = "88e5a4578435197799aa368fb1a5d87fe43e02a888cb7e85c2ad66173b383c89";
+ sha256 = "1xigv6c8xyb4g852nr3smz0137rnp81jvlikza071y7rc6pdzwza";
};
meta = with lib; {
@@ -18,4 +18,4 @@ buildPythonPackage rec {
license = licenses.mit;
# maintainers = [ maintainers. ];
};
-} \ No newline at end of file
+}
diff --git a/makefu/2configs/ham/default.nix b/makefu/2configs/ham/default.nix
index 6b2867c2d..ddcf65b5a 100644
--- a/makefu/2configs/ham/default.nix
+++ b/makefu/2configs/ham/default.nix
@@ -50,6 +50,8 @@ in {
logger = {
default = "info";
};
+ rest_command = {}
+ // the_playlist.rest_command;
tts = [
{ platform = "google_translate";
language = "de";
@@ -142,6 +144,7 @@ in {
++ (import ./automation/firetv_restart.nix)
++ kurzzeitwecker.automation
#++ flurlicht.automation
+ ++ the_playlist.automation
++ zigbee.automation;
script =
{ }
diff --git a/makefu/2configs/ham/multi/the_playlist.nix b/makefu/2configs/ham/multi/the_playlist.nix
index aa5ce85dc..ad090938c 100644
--- a/makefu/2configs/ham/multi/the_playlist.nix
+++ b/makefu/2configs/ham/multi/the_playlist.nix
@@ -1,9 +1,66 @@
+# Inputs:
+# binary_sensor.playlist_button_good
+# binary_sensor.playlist_button_bad
+
+# outputs
+# rest_command
+# automation
+# sensor
{
+ rest_command = {
+ good_song = {
+ url = "http://prism.r:8001/good";
+ method = "POST";
+ };
+ bad_song = {
+ url = "http://prism.r:8001/skip";
+ method = "POST";
+ };
+ };
+ automation = [
+ {
+ alias = "playlist song publish";
+ trigger = {
+ #platform = "event";
+ #event_data.entity_id = "sensor.the_playlist_song";
+ platform = "state";
+ entity_id = "sensor.the_playlist_song";
+ };
+ action = {
+ service = "mqtt.publish";
+ data = {
+ topic = "/ham/the_playlist/song";
+ payload_template = "{{ states.sensor.the_playlist_song.state }}";
+ };
+ };
+ }
+ {
+ alias = "playlist upvote on button";
+ trigger = {
+ platform = "state";
+ entity_id = "binary_sensor.playlist_button_good";
+ from = "off";
+ to = "on";
+ };
+ action.service = "rest_command.good_song";
+ }
+ {
+ alias = "playlist downvote on button";
+ trigger = {
+ platform = "state";
+ entity_id = "binary_sensor.playlist_button_bad";
+ from = "off";
+ to = "on";
+ };
+ action.service = "rest_command.bad_song";
+ }
+ ];
sensor = [
{ platform = "rest";
name = "pl";
resource = "http://prism.r:8001/current";
scan_interval = 30;
+ value_template = "1";
json_attributes = [ "name" "filename" "youtube" ];
}
{ platform = "template";