Skip to content

Commit

Permalink
mqtt: Use dynamic hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
lindhe committed Apr 1, 2024
1 parent 6f3525f commit 43fbafd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mqtt/mqtt_status/mqtt_battery_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ fi
if [[ "${IAMAT}" == '"home"' ]]; then
mosquitto_pub \
-h "${BROKER_HOSTNAME}" -p "${BROKER_PORT}" \
-t '/laptops/blaptop/battery/percentage' \
-t "/laptops/$(hostname)/battery/percentage" \
-m "$(cat /sys/class/power_supply/BAT0/capacity)"
mosquitto_pub \
-h "${BROKER_HOSTNAME}" -p "${BROKER_PORT}" \
-t '/laptops/blaptop/battery/power/state' \
-t "/laptops/$(hostname)/battery/power/state" \
-m "$(cat /sys/class/power_supply/AC/online)"
fi

0 comments on commit 43fbafd

Please sign in to comment.