Import smart-home into Gitea

This commit is contained in:
Claude
2026-07-30 18:39:43 -05:00
commit c79e0a2d87
7 changed files with 462 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# Quick-connect helper for the smart-home / Home Assistant project.
# Pulls the long-lived token from Vaultwarden (org "Homelab - Claude"),
# exports it as HA_TOKEN, and runs a connection test.
#
# Usage: pwsh -File scripts\connect.ps1 [command]
# (defaults to "ping")
param([string]$Command = "ping")
$ErrorActionPreference = "Stop"
$projRoot = Split-Path -Parent $PSScriptRoot
# Retrieve token from Bitwarden/Vaultwarden CLI (item name: "Home Assistant - RogueOne")
# Falls back to an already-set $env:HA_TOKEN if bw is unavailable.
if (-not $env:HA_TOKEN) {
try {
$env:HA_TOKEN = (bw get password "Home Assistant - RogueOne").Trim()
} catch {
Write-Warning "Could not read token from Bitwarden. Set `$env:HA_TOKEN manually."
}
}
if (-not $env:HA_TOKEN) { throw "HA_TOKEN not set." }
Push-Location $projRoot
try {
bun ha.js $Command
} finally {
Pop-Location
}