-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (57 loc) · 2.33 KB
/
Copy pathMakefile
File metadata and controls
68 lines (57 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Linus Dashboard - Minimal Development Commands
.PHONY: help dev build build-watch build-prod lint install bootstrap fake-house
# Default help
help:
@echo "🎯 Linus Dashboard Commands"
@echo ""
@echo " dev Start Home Assistant development server"
@echo " build Build frontend (development)"
@echo " build-watch Build frontend in watch mode"
@echo " build-prod Build frontend (production)"
@echo " lint Run linting and formatting"
@echo " install Install dependencies"
@echo " bootstrap Create the HA admin account + HA_TOKEN, no browser needed"
@echo " fake-house Provision the fake house test entities (bootstraps first if needed)"
@echo ""
# Start Home Assistant
dev:
@echo "📄 Loading environment..."
@if [ ! -e config/custom_components ]; then \
echo "🔗 Linking custom_components into config..."; \
ln -s ../custom_components config/custom_components; \
else \
echo "🔗 config/custom_components already exists, skipping symlink"; \
fi
@echo "🐍 Activating Python virtual environment..."
@echo "🚀 Starting Home Assistant on http://localhost:8123"
@. ./.env 2>/dev/null || true; \
./ha-env/bin/hass --config ./config
# Build frontend
build:
npm run build
build-watch:
npm run build-dev
build-prod:
npm run build-prod
# Linting
lint:
./ha-env/bin/ruff check . || true
./ha-env/bin/ruff format . || true
npx eslint src/ --fix || true
# Install dependencies
install:
./ha-env/bin/pip install -r requirements.txt
npm install
# Create the HA admin account and a long-lived HA_TOKEN in .env, entirely via
# the API (same one HA's own onboarding wizard uses) — no browser needed.
# Safe to re-run: no-ops immediately if .env already has a working HA_TOKEN.
bootstrap:
@set -a; . ./.env 2>/dev/null || true; set +a; \
HA_URL=$${HA_URL:-http://localhost:8123} ./ha-env/bin/python config/bootstrap_ha_onboarding.py
# Provision the fake house test entities (areas, floors, random sensors).
# Bootstraps first if .env has no working HA_TOKEN yet, so this is the one
# command that takes a fresh `make dev` all the way to a populated fake
# house — no browser, no manual token creation. Safe to re-run (idempotent).
fake-house: bootstrap
@set -a; . ./.env 2>/dev/null || true; set +a; \
HA_URL=$${HA_URL:-http://localhost:8123} ./ha-env/bin/python config/setup_fake_house_full.py