#!/bin/bash

# Load environment variables from .env file
source .env

# Turn off the external HDD
response=$(curl -s -X POST "$HA_URL/api/services/switch/turn_off" \
    -H "Authorization: Bearer $HA_TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"entity_id\": \"$HDD_SWITCH_ENTITY\"}")

echo "Powering off external HDD: $response"