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:
parent
c7949285d1
commit
8a0fa9604c
6
.gitignore
vendored
6
.gitignore
vendored
@ -28,3 +28,9 @@ system_stats_daemon-*.tar
|
||||
# Nix result symlinks
|
||||
result
|
||||
result-*
|
||||
|
||||
# Home Assistant development files
|
||||
dev-config/.storage/
|
||||
dev-config/home-assistant.log*
|
||||
dev-config/deps/
|
||||
dev-config/.cloud/
|
||||
|
||||
2
dev-config/automations.yaml
Normal file
2
dev-config/automations.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
# Development automations for testing Systant integration
|
||||
[]
|
||||
47
dev-config/configuration.yaml
Normal file
47
dev-config/configuration.yaml
Normal 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
2
dev-config/scenes.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
# Development scenes for testing Systant integration
|
||||
[]
|
||||
2
dev-config/scripts.yaml
Normal file
2
dev-config/scripts.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
# Development scripts for testing Systant integration
|
||||
{}
|
||||
14
flake.nix
14
flake.nix
@ -41,23 +41,33 @@
|
||||
python311Packages.pip
|
||||
python311Packages.ipython
|
||||
python311Packages.pytest
|
||||
python311Packages.homeassistant
|
||||
python311Packages.pytest-homeassistant-custom-component
|
||||
python311Packages.black
|
||||
python311Packages.isort
|
||||
python311Packages.flake8
|
||||
python311Packages.mypy
|
||||
|
||||
# Home Assistant for development
|
||||
home-assistant
|
||||
mosquitto
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "Systant development environment loaded"
|
||||
echo "Elixir: $(elixir --version | head -1)"
|
||||
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 "Directories:"
|
||||
echo " server/ - Elixir systant daemon"
|
||||
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 = {
|
||||
|
||||
1
server/dev-config/custom_components/systant
Symbolic link
1
server/dev-config/custom_components/systant
Symbolic link
@ -0,0 +1 @@
|
||||
../../home-assistant-integration/custom_components/systant
|
||||
Loading…
Reference in New Issue
Block a user