-
Notifications
You must be signed in to change notification settings - Fork 13
Use proper entity service schemas & replace async_forward_entry_setup with async_forward_entry_setups #159
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
Conversation
…_forward_entry_setups`
This commit addresses two deprecation warnings in the openHASP integration:
1. **Entity Service Schema**
Home Assistant 2025.9 and onward no longer allows registering entity services
with an empty `{}` schema. This commit adds minimal entity service schemas
for `SERVICE_WAKEUP`, `SERVICE_PAGE_NEXT`, and `SERVICE_PAGE_PREV` by using
`cv.make_entity_service_schema({})`. Additionally, the existing `PUSH_IMAGE`
service is updated to use `cv.make_entity_service_schema(...)` to ensure
compliance with future HA releases.
2. **async_forward_entry_setup Deprecation**
Replaces multiple `await hass.config_entries.async_forward_entry_setup(entry, domain)`
calls in a loop with a single `await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)`.
This ensures the setup lock is handled correctly and removes the related
deprecation warning.
These changes make the custom component compatible with the upcoming breaking
changes in Home Assistant 2025.x and beyond, preventing warnings and ensuring a
smooth user experience.
| WAKEUP_SERVICE_SCHEMA = cv.make_entity_service_schema({}) | ||
| PAGE_NEXT_SERVICE_SCHEMA = cv.make_entity_service_schema({}) | ||
| PAGE_PREV_SERVICE_SCHEMA = cv.make_entity_service_schema({}) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should also include the other services , just to maintain everything coherent
When a plate reports its IP address in the statusupdate message, this change: - Updates the config entry's DISCOVERED_URL so the integration tracks the current IP - The device registry configuration_url is automatically updated on the next async_get_or_create call Uses a helper function make_plate_url() to construct URLs consistently. Addresses maintainer feedback: - Removed duplicate entity service schema changes (handled in PR HASwitchPlate#159) - Added helper function for URL generation - Uses dict spread syntax for cleaner config entry update
…rvices Per dgomes' feedback, updated ALL entity services to use cv.make_entity_service_schema() for consistency, not just the ones with empty schemas. This fixes: - Variable naming bug (WAKEUP_SERVICE_SCHEMA vs WAKEUP_SCHEMA) - Applies consistent schema wrapping to PAGE_CHANGE, LOAD_PAGE, CLEAR_PAGE, COMMAND, and CONFIG services
|
Hi @dgomes, apologies for the delayed response - I had this fixed in my local codebase and didn't notice the review feedback until recently. I've updated the PR to address your feedback: ✅ All entity services now use
This also fixes a bug where I had defined variables like Thanks for catching this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the openHASP integration to align with Home Assistant's evolving API requirements by wrapping service schemas with cv.make_entity_service_schema() and consolidating platform setup calls. The changes address deprecation warnings for upcoming Home Assistant releases while maintaining backward compatibility.
Key Changes:
- All entity service registrations now use
cv.make_entity_service_schema()instead of bare dictionary schemas - Code formatting improvements for multi-line service registrations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull Request Description:
This PR addresses two deprecation warnings introduced in upcoming Home Assistant releases:
• Previously, services like SERVICE_WAKEUP, SERVICE_PAGE_NEXT, and SERVICE_PAGE_PREV were registered using empty {} schemas, which Home Assistant will stop supporting. Now, these services use cv.make_entity_service_schema({}), ensuring they meet the new requirements for entity service schemas.
• The integration previously looped over each platform with async_forward_entry_setup, which is deprecated. This has been updated to a single call to async_forward_entry_setups, which aligns with current Home Assistant best practices and avoids deprecation warnings.
With these changes, openHASP remains compatible with future Home Assistant releases, preventing warnings and ensuring a smoother user experience.