funge
This commit is contained in:
parent
789640998a
commit
197264f27a
7 changed files with 488 additions and 59 deletions
46
local_run/manage_noi_sensors.sh
Executable file
46
local_run/manage_noi_sensors.sh
Executable file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Helper script to manage NOI sensors
|
||||
# Usage: ./manage_noi_sensors.sh [add|list|scrape] [args...]
|
||||
|
||||
COMPOSE_EXEC="docker compose exec -T c3nav-core python manage.py"
|
||||
|
||||
case "$1" in
|
||||
"add")
|
||||
if [ $# -lt 6 ]; then
|
||||
echo "Usage: $0 add <sensor-id> <name> <x> <y> <level>"
|
||||
echo "Example: $0 add 'NOI:MyNewSensor' 'My New Sensor' 300.0 250.0 floor1"
|
||||
exit 1
|
||||
fi
|
||||
SENSOR_ID="$2"
|
||||
NAME="$3"
|
||||
X="$4"
|
||||
Y="$5"
|
||||
LEVEL="$6"
|
||||
echo "Adding sensor: $NAME ($SENSOR_ID) at ($X, $Y) on $LEVEL"
|
||||
$COMPOSE_EXEC add_sensor --overlay-id 1 --sensor-id "$SENSOR_ID" --name "$NAME" --x "$X" --y "$Y" --level "$LEVEL"
|
||||
;;
|
||||
"list")
|
||||
echo "Listing all sensors in overlay 1:"
|
||||
$COMPOSE_EXEC list_sensors --overlay-id 1
|
||||
;;
|
||||
"scrape")
|
||||
echo "Scraping data for all sensors in overlay 1:"
|
||||
$COMPOSE_EXEC manage_sensors --scrape-data --overlay-id 1
|
||||
;;
|
||||
*)
|
||||
echo "NOI Sensor Management Helper"
|
||||
echo "Usage: $0 [add|list|scrape] [args...]"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " add <sensor-id> <name> <x> <y> <level> - Add a new sensor"
|
||||
echo " list - List all sensors"
|
||||
echo " scrape - Scrape data for all sensors"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 add 'NOI:NewSensor' 'My Sensor' 300.0 250.0 floor1"
|
||||
echo " $0 list"
|
||||
echo " $0 scrape"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue