Add Home Assistant development environment to flake

- Add home-assistant and mosquitto to dev shell
- Create minimal dev-config/ for HA development instance
- Symlink custom integration for easy testing
- Add HA dev files to .gitignore
- No HA codebase committed, just references via Nix

Usage:
  nix develop
  hass --config ./dev-config

Features:
- Isolated from production HA instance
- MQTT broker for testing
- Debug logging enabled
- In-memory database for fast iteration
This commit is contained in:
ryan 2025-08-02 21:00:07 -07:00
parent c7949285d1
commit 8a0fa9604c
7 changed files with 72 additions and 2 deletions

6
.gitignore vendored
View File

@ -28,3 +28,9 @@ system_stats_daemon-*.tar
# Nix result symlinks # Nix result symlinks
result result
result-* result-*
# Home Assistant development files
dev-config/.storage/
dev-config/home-assistant.log*
dev-config/deps/
dev-config/.cloud/

View File

@ -0,0 +1,2 @@
# Development automations for testing Systant integration
[]

View File

@ -0,0 +1,47 @@
# Home Assistant Development Configuration for Systant Integration
homeassistant:
name: Systant Development
latitude: 0
longitude: 0
elevation: 0
unit_system: metric
time_zone: UTC
# Enable configuration UI
config:
# Enable frontend
frontend:
themes: !include_dir_merge_named themes
# Enable API
api:
# Enable system health
system_health:
# Enable mobile app support
mobile_app:
# MQTT Configuration (connect to local broker)
mqtt:
broker: localhost
port: 1883
discovery: true
discovery_prefix: homeassistant
# Enable logging
logger:
default: info
logs:
custom_components.systant: debug
homeassistant.components.mqtt: debug
# Enable recorder with in-memory database for development
recorder:
db_url: "sqlite:///:memory:"
purge_keep_days: 1
# Enable default integrations
default_config:

2
dev-config/scenes.yaml Normal file
View File

@ -0,0 +1,2 @@
# Development scenes for testing Systant integration
[]

2
dev-config/scripts.yaml Normal file
View File

@ -0,0 +1,2 @@
# Development scripts for testing Systant integration
{}

View File

@ -41,23 +41,33 @@
python311Packages.pip python311Packages.pip
python311Packages.ipython python311Packages.ipython
python311Packages.pytest python311Packages.pytest
python311Packages.homeassistant
python311Packages.pytest-homeassistant-custom-component python311Packages.pytest-homeassistant-custom-component
python311Packages.black python311Packages.black
python311Packages.isort python311Packages.isort
python311Packages.flake8 python311Packages.flake8
python311Packages.mypy python311Packages.mypy
# Home Assistant for development
home-assistant
mosquitto
]; ];
shellHook = '' shellHook = ''
echo "Systant development environment loaded" echo "Systant development environment loaded"
echo "Elixir: $(elixir --version | head -1)" echo "Elixir: $(elixir --version | head -1)"
echo "Python: $(python --version)" echo "Python: $(python --version)"
echo "Available tools: pytest, black, isort, flake8, mypy" echo "Home Assistant: $(hass --version)"
echo ""
echo "Available tools: pytest, black, isort, flake8, mypy, mosquitto"
echo "" echo ""
echo "Directories:" echo "Directories:"
echo " server/ - Elixir systant daemon" echo " server/ - Elixir systant daemon"
echo " home-assistant-integration/ - Home Assistant custom integration" echo " home-assistant-integration/ - Home Assistant custom integration"
echo " dev-config/ - Home Assistant development configuration"
echo ""
echo "Commands:"
echo " hass --config ./dev-config - Start HA dev instance"
echo " mosquitto - Start MQTT broker for testing"
''; '';
}; };
packages = { packages = {

View File

@ -0,0 +1 @@
../../home-assistant-integration/custom_components/systant