From 21e8ad2afd04b869d00150b8c577b27a09733b59 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 22 Jun 2024 19:54:06 -0500 Subject: [PATCH] home-assistant: Add commands to control photoframe The digital photo frame in the kitchen is powered by a server service, which exposes a minimal HTTP API. Using this API, we can e.g. advance or backtrack the displayed photo. Exposing `rest_command` services for these operations allows us to add buttons to dashboards to control the frame. --- home-assistant/configuration.yaml | 1 + home-assistant/kustomization.yaml | 1 + home-assistant/rest-command.yaml | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100644 home-assistant/rest-command.yaml diff --git a/home-assistant/configuration.yaml b/home-assistant/configuration.yaml index 926b7c1..5af2286 100644 --- a/home-assistant/configuration.yaml +++ b/home-assistant/configuration.yaml @@ -54,6 +54,7 @@ automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml shell_command: !include /run/config/shell-command.yaml +rest_command: !include /run/config/rest-command.yaml lovelace: mode: storage diff --git a/home-assistant/kustomization.yaml b/home-assistant/kustomization.yaml index 746e057..3c66d4e 100644 --- a/home-assistant/kustomization.yaml +++ b/home-assistant/kustomization.yaml @@ -27,6 +27,7 @@ configMapGenerator: - groups.yaml - restart-diddy-mopidy.sh - shell-command.yaml + - rest-command.yaml options: disableNameSuffixHash: true labels: diff --git a/home-assistant/rest-command.yaml b/home-assistant/rest-command.yaml new file mode 100644 index 0000000..f702eb9 --- /dev/null +++ b/home-assistant/rest-command.yaml @@ -0,0 +1,7 @@ +photoframe_next: + url: https://photos.pyrocufflink.blue/next + method: post + +photoframe_prev: + url: https://photos.pyrocufflink.blue/prev + method: post