-
Notifications
You must be signed in to change notification settings - Fork 94
Migrate to Govee API v2.0 with full feature support #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lasswellt
wants to merge
8
commits into
LaggAt:master
Choose a base branch
from
lasswellt:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Fix swapped min/max color temp properties (min_color_temp_kelvin now returns 2000K, max_color_temp_kelvin returns 9000K) - Add missing await to async_forward_entry_unload call in _unload_component_entry to prevent race conditions - Add error handling to async_turn_off to log API errors (matching async_turn_on pattern) - Replace hass.states.set debug calls with _LOGGER.debug to avoid polluting Home Assistant state machine - Add unit tests for color temp properties and turn_off error handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add comprehensive type hints throughout __init__.py, light.py, and config_flow.py - Increase default poll interval from 10s to 30s for better rate limit safety - Update stale comment about single request API change - Fix inconsistent error key naming (govee_ex -> govee_error) - Add govee_error translation key to strings.json and en.json 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Major refactoring to replace external govee-api-laggat library with inline v2.0 API client. This enables full feature support including scenes, segments, music modes, and modern Home Assistant patterns. Changes: - Add inline API client (api/) with rate limiting and all v2.0 endpoints - Add typed data models (models.py) for devices, state, capabilities - Add DataUpdateCoordinator pattern (coordinator.py) - Add base entity class (entity.py) with CoordinatorEntity - Refactor light.py with capability-based features and effects - Add select platform for dynamic/DIY scene selection - Add switch platform for smart plugs/sockets - Add services: set_segment_color, set_segment_brightness, set_music_mode, refresh_scenes - Add config entry migration from v1 to v2 - Update manifest to remove external dependency (v2025.2.0) - Remove learning_storage.py (no longer needed with v2.0 API) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add table of contents for easy navigation - Add detailed HACS and manual installation instructions - Add step-by-step API key acquisition guide - Document all configuration options with tables - Add supported devices section - Document new features: scenes, segments, music mode - Add complete service reference with parameters - Add troubleshooting section with common issues - Add debug logging instructions - Update for Govee API v2.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Change HACS badge from Default to Custom - Add custom repository installation instructions - Update version to 2025.12.1 in README and manifest.json 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update GitHub badges to lasswellt/hacs-govee - Update HACS custom repository URL - Update manifest.json codeowners, documentation, issue_tracker - Update support links in README 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Features: - Add Night Light toggle switch for devices that support it (e.g., H601F) - Night Light state tracking in device state model - New set_nightlight() API method Fixes: - Skip SameModeGroup, BaseGroup, and DreamViewScenic pseudo-devices - These Govee Home app groups don't support API control (return 400 errors) - Prevents "unavailable" entities and API error spam Version bumped to 2025.12.2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Complete rewrite of the Govee integration to use the official Govee API v2.0 with capability-based architecture, modern Home Assistant patterns, and full feature support.
Breaking Changes
govee-api-laggatlibrary - now uses inline API clientNew Features
API v2.0 Migration
Light Platform Enhancements
New Platforms & Entities
New Services
govee.set_segment_color- Set color for specific RGBIC segmentsgovee.set_segment_brightness- Set brightness for specific segmentsgovee.set_music_mode- Activate music reactive modesgovee.refresh_scenes- Refresh scene list from cloudBug Fixes
Technical Changes
Modern Home Assistant Patterns
runtime_datapattern for typed config entry dataCoordinatorEntitybase class for all entitiesasync_forward_entry_setups(HA 2024.6+)New Files
api/- Complete v2.0 API client packageclient.py- GoveeApiClient with all endpointsconst.py- API constants and capability typesexceptions.py- Typed exceptionscoordinator.py- DataUpdateCoordinator for state managemententity.py- GoveeEntity base classmodels.py- Typed dataclasses for devices and stateselect.py- Scene select entitiesswitch.py- Smart plug and night light switchesservices.py- Service registrationservices.yaml- Service definitionsModified Files
__init__.py- Runtime data pattern, migration supportlight.py- Full rewrite with capability-based featuresconfig_flow.py- Uses new API client for validationconst.py- Platform mappings, device types, unsupported SKUsmanifest.json- Removed external dependencystrings.json/translations/en.json- New entity and service translationsRemoved Files
learning_storage.py- No longer needed with v2.0 APISupported Devices
Testing
Screenshots
N/A - Backend changes only
Related Issues
Checklist