Skip to content

Remove deprecated support for lock sensors and corresponding actions in lcn #147143

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

Merged
merged 8 commits into from
Jul 4, 2025

Conversation

alengwenus
Copy link
Contributor

@alengwenus alengwenus commented Jun 19, 2025

Breaking change

The binary sensors and actions for the lock states of regulators and the lock states of keys have been removed from the LCN integration. They have been replaced by the corresponding switch entities.

Proposed change

Support for binary sensors and the corresponding actions for the lock states of regulators and the lock states of keys have been marked deprecated in #35103.

Instead switch entities were added which also allow for setting the lock state.

Functionality for adding the binary sensor entities are removed from the LCN configuration frontend. For this the lcn-frontend package has to be bumped to the latest version:

Release notes: https://github.com/alengwenus/lcn-frontend/releases
Code changes: alengwenus/lcn-frontend@0.2.5...0.2.6

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@alengwenus alengwenus changed the title Remove deprecated support for lock sensors and corresponding actions Remove deprecated support for lock sensors and corresponding actions in lcn Jun 19, 2025
@alengwenus alengwenus force-pushed the dev-lcn-remove-lock-sensors branch from ab262fd to 95fc4d8 Compare June 19, 2025 15:59
@@ -8,5 +8,5 @@
"documentation": "https://www.home-assistant.io/integrations/lcn",
"iot_class": "local_push",
"loggers": ["pypck"],
"requirements": ["pypck==0.8.8", "lcn-frontend==0.2.5"]
"requirements": ["pypck==0.8.8", "lcn-frontend==0.2.6"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we bump this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frontend allows you to configure the sensors that have now been removed. Accordingly, the frontend also had to be adapted.
I could put it in a separate PR if you prefer. I just thought that it was part of the changes in this PR.

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft June 20, 2025 11:36
@alengwenus alengwenus force-pushed the dev-lcn-remove-lock-sensors branch 3 times, most recently from e3ce811 to 8128970 Compare June 20, 2025 13:35
@alengwenus alengwenus marked this pull request as ready for review June 20, 2025 14:01
@home-assistant home-assistant bot requested a review from joostlek June 20, 2025 14:01
@alengwenus alengwenus force-pushed the dev-lcn-remove-lock-sensors branch 3 times, most recently from 67323a8 to c964579 Compare June 25, 2025 11:49
@alengwenus alengwenus force-pushed the dev-lcn-remove-lock-sensors branch 3 times, most recently from 42a441a to 218e428 Compare July 1, 2025 17:50
@alengwenus alengwenus force-pushed the dev-lcn-remove-lock-sensors branch from 218e428 to 5354614 Compare July 2, 2025 07:39
@frenck frenck requested a review from Copilot July 3, 2025 21:04
@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Jul 3, 2025
Copy link
Contributor

@Copilot 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 removes deprecated binary sensors for regulator locks and key locks in the LCN integration, simplifies entity registration, and bumps the lcn-frontend dependency to the latest version.

  • Drop LcnRegulatorLockSensor and LcnLockKeysSensor (and related tests/snapshots/fixtures)
  • Simplify add_lcn_entities to only register generic binary sensors
  • Bump lcn-frontend to 0.2.6 in requirements and manifest.json

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/components/lcn/test_binary_sensor.py Removed tests targeting deprecated lock and key binary sensors
tests/components/lcn/snapshots/test_binary_sensor.ambr Pruned snapshots for removed lock/key sensors
tests/components/lcn/fixtures/config_entry_pchk.json Removed fixture entries for deprecated sensors
requirements_test_all.txt Updated lcn-frontend test dependency to 0.2.6
requirements_all.txt Updated lcn-frontend runtime dependency to 0.2.6
homeassistant/components/lcn/manifest.json Bumped lcn-frontend requirement to 0.2.6
homeassistant/components/lcn/binary_sensor.py Deleted the two specialized lock sensor classes and streamlined entity setup
Comments suppressed due to low confidence (1)

homeassistant/components/lcn/binary_sensor.py:30

  • The new switch entities for regulator locks and key locks introduced to replace the deprecated binary sensors are not covered by any tests in this PR. Consider adding tests to verify that the switch entities are registered correctly and respond as expected to lock/unlock commands.
    entities = [

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @alengwenus 👍

../Frenck

@frenck frenck dismissed joostlek’s stale review July 4, 2025 20:55

Comment addressed

@frenck frenck merged commit 8f24ebe into home-assistant:dev Jul 4, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change by-code-owner cla-signed has-tests integration: lcn Quality Scale: No score small-pr PRs with less than 30 lines. smash Indicator this PR is close to finish for merging or closing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants