From 8e651f2d7db5f609ea89f5b3ec78f2f3d6e06319 Mon Sep 17 00:00:00 2001 From: Penelope Gwen Date: Thu, 24 Apr 2025 16:00:02 -0700 Subject: [PATCH] New backup 2025-04-24 16:00:02 --- de/home/.config/eww/modules/home/shortcuts.yuck | 2 +- de/home/.config/eww/scripts/home/hass_weather | 14 +++++++------- default/home/.local/bin/hass-cli | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/de/home/.config/eww/modules/home/shortcuts.yuck b/de/home/.config/eww/modules/home/shortcuts.yuck index 3674481..93ef380 100644 --- a/de/home/.config/eww/modules/home/shortcuts.yuck +++ b/de/home/.config/eww/modules/home/shortcuts.yuck @@ -14,7 +14,7 @@ (button :width 60 :height 60 - :onclick "hass-cli -a services -e light.penny_room_all_lights -d light -s toggle" + :onclick "hass-cli -a services -I area_id -i left_bedroom -d light -s toggle" (image :image-width 20 :path "icons/home/shortcuts/personal/ceiling-light-multiple.svg" diff --git a/de/home/.config/eww/scripts/home/hass_weather b/de/home/.config/eww/scripts/home/hass_weather index e01e85e..c4cf5ab 100755 --- a/de/home/.config/eww/scripts/home/hass_weather +++ b/de/home/.config/eww/scripts/home/hass_weather @@ -4,19 +4,19 @@ hass_weather_cache="${HOME}/.cache/hass_weather.json" update_cache_json(){ # condition="$(jq -r '.current_condition[0].weatherDesc[0].value' ${hass_weather_cache})" - condition="$(hass-cli -a states -e sensor.openweathermap_weather | jq -r '.state')" + condition="$(hass-cli -a states -i sensor.openweathermap_weather | jq -r '.state')" # condition_code="$(jq -r '.current_condition[0].weatherCode' ${hass_weather_cache})" - condition_code="$(hass-cli -a states -e sensor.openweathermap_weather_code | jq -r '.state')" + condition_code="$(hass-cli -a states -i sensor.openweathermap_weather_code | jq -r '.state')" # current_temp="$(jq -r '.current_condition[0].temp_F' ${hass_weather_cache})" - current_temp="$(hass-cli -a states -e sensor.openweathermap_temperature | jq -r '.state')" + current_temp="$(hass-cli -a states -i sensor.openweathermap_temperature | jq -r '.state')" # feels_temp="$(jq -r '.current_condition[0].FeelsLikeF' ${hass_weather_cache})" - feels_temp="$(hass-cli -a states -e sensor.openweathermap_feels_like_temperature | jq -r '.state')" + feels_temp="$(hass-cli -a states -i sensor.openweathermap_feels_like_temperature | jq -r '.state')" # min_temp="$(jq -r '.weather[0].mintempF' ${hass_weather_cache})" - min_temp="$(hass-cli -a states -e sensor.eugene_weather_realfeel_temperature_min_day_0 | jq -r '.state')" + min_temp="$(hass-cli -a states -i sensor.eugene_weather_realfeel_temperature_min_day_0 | jq -r '.state')" # max_temp="$(jq -r '.weather[0].maxtempF' ${hass_weather_cache})" - max_temp="$(hass-cli -a states -e sensor.eugene_weather_realfeel_temperature_max_day_0 | jq -r '.state')" + max_temp="$(hass-cli -a states -i sensor.eugene_weather_realfeel_temperature_max_day_0 | jq -r '.state')" # humidity="$(jq -r '.current_condition[0].humidity' ${hass_weather_cache})" - humidity="$(hass-cli -a states -e sensor.openweathermap_humidity | jq -r '.state')" + humidity="$(hass-cli -a states -i sensor.openweathermap_humidity | jq -r '.state')" # updated="$(date -r ${hass_weather_cache} '+%Y-%m-%d, %H:%M')" updated="$(date '+%Y-%m-%d, %H:%M')" diff --git a/default/home/.local/bin/hass-cli b/default/home/.local/bin/hass-cli index ef80753..bf59542 100755 --- a/default/home/.local/bin/hass-cli +++ b/default/home/.local/bin/hass-cli @@ -11,6 +11,7 @@ while getopts "a:I:i:d:s:" flag; do ;; I) identify_by="${OPTARG}" + ;; i) identifier="${OPTARG}" ;; @@ -34,7 +35,7 @@ case "${action}" in curl -s \ -H "Authorization: Bearer ${HA_TOKEN}" \ -H "Content-Type: application/json" \ - "${HA_URL}/api/${action}/${entity_id}" | jq '.' + "${HA_URL}/api/${action}/${identifier}" | jq '.' ;; "services") # echo '{"entity_id": "'"${entity_id}"'"}'