feat: migrate to i3blocks and autotiling-rs
This commit is contained in:
parent
ce241fd98d
commit
487870a473
14 changed files with 512 additions and 7 deletions
18
home/oli/bin/i3blocks/homeassistant-fast
Executable file
18
home/oli/bin/i3blocks/homeassistant-fast
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Needs a .env.homeassistant with an API token in ~/.config/sway/.env.homeassistant
|
||||
# TODO:
|
||||
# - HA optimize API calls: https://community.home-assistant.io/t/get-limited-number-of-states-entities-when-using-api-states/830323
|
||||
|
||||
homeassistant_url="http://10.7.1.11:8123/api/states"
|
||||
. ~/.config/sway/.env.homeassistant
|
||||
|
||||
. ~/bin/i3blocks/_utils
|
||||
|
||||
ha() {
|
||||
local power=$(curl -s -H "Authorization: Bearer $ha_token" -H "Content-Type: application/json" $homeassistant_url/sensor.inspelning_oli_power | jq -r '.state')
|
||||
local stat="PWR ${power}W"
|
||||
echo "$stat"
|
||||
}
|
||||
|
||||
ha
|
||||
Loading…
Add table
Add a link
Reference in a new issue