Skip to content

Conversation

@wjnelson78
Copy link
Contributor

Pull Request Description:

This PR addresses two deprecation warnings introduced in upcoming Home Assistant releases:

  1. Proper entity service schemas

• 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.

  1. Switch to async_forward_entry_setups

• 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.

…_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({})

Copy link
Collaborator

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

wjnelson78 added a commit to wjnelson78/openHASP-custom-component that referenced this pull request Dec 15, 2025
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
Copilot AI review requested due to automatic review settings December 15, 2025 21:08
@wjnelson78
Copy link
Contributor Author

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 cv.make_entity_service_schema() for consistency, including:

  • SERVICE_PAGE_CHANGE
  • SERVICE_LOAD_PAGE
  • SERVICE_CLEAR_PAGE
  • SERVICE_COMMAND
  • SERVICE_CONFIG

This also fixes a bug where I had defined variables like WAKEUP_SERVICE_SCHEMA but was referencing WAKEUP_SCHEMA in the registration calls.

Thanks for catching this!

Copy link

Copilot AI left a 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.

@fvanroie fvanroie merged commit 6b95e76 into HASwitchPlate:main Dec 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants