From c368e04c18d2d1e1a0d02a1ae9bbf2a5a940655b Mon Sep 17 00:00:00 2001 From: Eric Loyd Date: Tue, 23 Dec 2025 13:01:56 -0500 Subject: [PATCH] Udpates --- AstropotaPOD.sh | 20 ++++++++++---------- govee.sh | 22 +++++++++++++++------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/AstropotaPOD.sh b/AstropotaPOD.sh index e6d94ae..d0f331a 100755 --- a/AstropotaPOD.sh +++ b/AstropotaPOD.sh @@ -91,22 +91,22 @@ do_start() { do_poweroff() { do_getKey case "$myDevice" in - quad*|all) do_api "/Driver/PPBAdvance/Power/Hub/Off?DriverUniqueKey=${PPBAkey}" PUT "Turning Off Quad Power..." | jq '.status';;& - var*|all) do_api "/Driver/PPBAdvance/Power/Variable/Off?DriverUniqueKey=${PPBAkey}" PUT "Turning Off Variable Power..." | jq '.status';;& - dew1|all) do_api "/Driver/PPBAdvance/Dew/1/Off?DriverUniqueKey=${PPBAkey}" PUT "Turning Off Dew Heater 1..." | jq '.status';;& - dew2|all) do_api "/Driver/PPBAdvance/Dew/2/Off?DriverUniqueKey=${PPBAkey}" PUT "Turning Off Dew Heater 2..." | jq '.status';;& - autodew|all) do_api "/Driver/PPBAdvance/Dew/Auto/Off?DriverUniqueKey=${PPBAkey}" POST "Turning Off Auto Dew..." | jq '.status';; + Quad|quad*|All|all) do_api "/Driver/PPBAdvance/Power/Hub/Off?DriverUniqueKey=${PPBAkey}" PUT "Turning Off Quad Power..." | jq '.status';;& + Var|var*|All|all) do_api "/Driver/PPBAdvance/Power/Variable/Off?DriverUniqueKey=${PPBAkey}" PUT "Turning Off Variable Power..." | jq '.status';;& + Dew1|dew1|All|all) do_api "/Driver/PPBAdvance/Dew/1/Off?DriverUniqueKey=${PPBAkey}" PUT "Turning Off Dew Heater 1..." | jq '.status';;& + Dew2|dew2|All|all) do_api "/Driver/PPBAdvance/Dew/2/Off?DriverUniqueKey=${PPBAkey}" PUT "Turning Off Dew Heater 2..." | jq '.status';;& + Auto*|auto*|All|all) do_api "/Driver/PPBAdvance/Dew/Auto/Off?DriverUniqueKey=${PPBAkey}" POST "Turning Off Auto Dew..." | jq '.status';; esac } do_poweron() { do_getKey case "$myDevice" in - quad*|all) do_api "/Driver/PPBAdvance/Power/Hub/On?DriverUniqueKey=${PPBAkey}" PUT "Turning on Quad Power..." | jq '.status';;& - var*|all) do_api "/Driver/PPBAdvance/Power/Variable/On?DriverUniqueKey=${PPBAkey}" PUT "Turning on Variable Power..." | jq '.status';;& - dew1|all) do_api "/Driver/PPBAdvance/Dew/1/On?DriverUniqueKey=${PPBAkey}" PUT "Turning on Dew Heater 1..." | jq '.status';;& - dew2|all) do_api "/Driver/PPBAdvance/Dew/2/On?DriverUniqueKey=${PPBAkey}" PUT "Turning on Dew Heater 2..." | jq '.status';;& - autodew|all) do_api "/Driver/PPBAdvance/Dew/Auto/On?DriverUniqueKey=${PPBAkey}" POST "Turning on Auto Dew..." | jq '.status';; + Quad|quad*|All|all) do_api "/Driver/PPBAdvance/Power/Hub/On?DriverUniqueKey=${PPBAkey}" PUT "Turning on Quad Power..." | jq '.status';;& + Var*|var*|All|all) do_api "/Driver/PPBAdvance/Power/Variable/On?DriverUniqueKey=${PPBAkey}" PUT "Turning on Variable Power..." | jq '.status';;& + Dew1|dew1|All|all) do_api "/Driver/PPBAdvance/Dew/1/On?DriverUniqueKey=${PPBAkey}" PUT "Turning on Dew Heater 1..." | jq '.status';;& + Dew2|dew2|All|all) do_api "/Driver/PPBAdvance/Dew/2/On?DriverUniqueKey=${PPBAkey}" PUT "Turning on Dew Heater 2..." | jq '.status';;& + Auto*|auto|All|all) do_api "/Driver/PPBAdvance/Dew/Auto/On?DriverUniqueKey=${PPBAkey}" POST "Turning on Auto Dew..." | jq '.status';; esac } diff --git a/govee.sh b/govee.sh index f6584b6..805746b 100755 --- a/govee.sh +++ b/govee.sh @@ -17,14 +17,22 @@ if [[ -z "$API_KEY" ]]; then fi get_info() { - local entry="router/api/v1/user/devices" - json=$(curl -s -k ${API_BASE}/${entry} \ + local reqid + reqid="$(uuid)" +# local entry="router/api/v1/user/devices" +# json=$(curl -s -k ${API_BASE}/${entry} \ +# -H "Content-Type: application/json" \ +# -H "Govee-API-Key: ${API_KEY}") +# sku=$(echo "$json" | jq -r ".data[].sku") +# device=$(echo "$json" | jq -r ".data[].device") +echo curl -s -k -X POST "${API_BASE}/router/api/v1/device/state" \ -H "Content-Type: application/json" \ - -H "Govee-API-Key: ${API_KEY}") - sku=$(echo "$json" | jq -r ".data[].sku") - device=$(echo "$json" | jq -r ".data[].device") - echo "SKU=$sku" - echo "device=$device" + -H "Govee-API-Key: ${API_KEY}" \ + -d "{ \"requestId\": \"${uuid}\", \"payload\": { \"sku\": \"${mySKU}\", \"device\": \"${myID}\" } }" +# echo "SKU=$sku" +# echo "device=$device" +# echo "json:" + echo "$json" } # helpers