This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Home Assistant custom integration for Orbit B-hyve irrigation devices. It provides support for smart sprinkler controllers, flood sensors, and faucet timers through the B-hyve cloud service.
./scripts/setup- Install dependencies and Claude Codepip install -r requirements.txt- Install Python dependencies
./scripts/develop- Run Home Assistant in development mode with this integration loaded./scripts/lint- Format and lint code using ruff
./scripts/test- Run all tests with verbose outputpytest tests/- Run tests directlypytest tests/test_valve.py- Run specific test file- Testing setup uses
pytest-homeassistant-custom-component
ruff format .- Format Python coderuff check . --fix- Lint and auto-fix issues- Code formatting follows Black style with pylint integration
custom_components/bhyve/- Main integration directorycustom_components/bhyve/__init__.py- Integration setup and coordinatorcustom_components/bhyve/pybhyve/- B-hyve API client libraryconfig/- Home Assistant configuration for development
- API Client:
pybhyve/client.py- Handles authentication and API communication - WebSocket:
pybhyve/websocket.py- Real-time device updates - Platforms:
sensor.py- Battery levels, device state, watering historyswitch.py- Zone controls, rain delays, programsbinary_sensor.py- Flood detection, temperature alertsvalve.py- Valve entity implementation
- Config Flow:
config_flow.py- Integration setup UI - Services: Custom services for advanced watering control
The integration supports multiple B-hyve device types:
- Sprinkler Timers: Multi-zone controllers with scheduling
- Faucet Timers: Single-zone hose faucet controllers
- Flood Sensors: Water detection and temperature monitoring
- Each device creates multiple entities across different platforms
- Zone switches control individual watering zones
- Program switches manage pre-configured watering schedules
- Sensors track battery, device state, and watering history
- Rain delay switches manage weather-based watering postponement
- Uses Home Assistant config flow for setup
- Stores credentials securely in config entries
- No YAML configuration required (legacy YAML support deprecated)
- Integration type: "hub" with "cloud_push" IoT class
- Uses VS Code dev containers (
.devcontainer.json) - Custom PYTHONPATH setup to load integration from source
- Home Assistant runs in debug mode during development
- Configuration stored in
config/directory
- This integration communicates with Orbit's cloud service, not local devices
- WiFi hub required for faucet timers and flood sensors
- Integration follows Home Assistant custom component standards
- Version managed in
manifest.json - HACS compatible with automatic updates