Skip to content

Developer Scripts

Jason Rhubottom edited this page Apr 20, 2026 · 1 revision

Developer Scripts

All development scripts are located in the scripts/ directory and follow a consistent pattern.

Setup Script

Purpose: Initial development environment setup

./scripts/setup

What it does:

  • Installs Python development dependencies
  • Sets up pre-commit hooks
  • Validates environment

When to use:

  • First time setting up the project
  • After pulling major changes that update dependencies
  • When pre-commit hooks need to be reinstalled

Development Server

Purpose: Run Home Assistant with the integration loaded for testing

./scripts/develop

What it does:

  • Creates config/ directory if not present
  • Sets PYTHONPATH to include custom_components/
  • Starts Home Assistant with debug logging
  • Uses config/configuration.yaml for test setup with mock entities

Features:

  • Hot reload: Changes to Python files are reflected after restart
  • Debug logging: Verbose output for troubleshooting
  • Mock entities: Pre-configured test entities in config/configuration.yaml

Access:

Tips:

  • Keep the terminal open to see logs in real-time
  • Press Ctrl+C to stop the server
  • Changes require a Home Assistant restart to take effect

Linting Script

Purpose: Run code quality checks and auto-fix issues

./scripts/lint

What it does:

  • Runs ruff check . --fix - Linting with auto-fix
  • Runs ruff format . - Code formatting

When to use:

  • Before committing changes
  • After writing new code
  • When fixing linting errors

Note: Pre-commit hooks run this automatically on git commit

Release Script

Purpose: Automate the entire release process

See the Developer Release Process page for detailed documentation.

Clone this wiki locally