Skip to content

Add lock platform to Volvo integration#154168

Merged
gjohansson-ST merged 7 commits into
home-assistant:devfrom
thomasddn:volvo/feature/lock
Nov 2, 2025
Merged

Add lock platform to Volvo integration#154168
gjohansson-ST merged 7 commits into
home-assistant:devfrom
thomasddn:volvo/feature/lock

Conversation

@thomasddn
Copy link
Copy Markdown
Contributor

@thomasddn thomasddn commented Oct 10, 2025

Proposed change

Add lock platform to Volvo integration.

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

Checklist

  • I understand the code I am submitting and can explain how it works.
  • 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.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

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:

@raido
Copy link
Copy Markdown

raido commented Oct 11, 2025

👋 Hello, just sharing recently opened discussion to link things together.

Glad to see recent actions/buttons and device tracker features. 🎉

Copy link
Copy Markdown
Member

@gjohansson-ST gjohansson-ST left a comment

Choose a reason for hiding this comment

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

Codes looks fine but I'm hesitant to make two locks for the same lock
Should this not be one lock and possibly something else to set if it's full lock or reduced? Not sure myself was is the better approach.

@thomasddn
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback @gjohansson-ST!

In the Volvo app there is one dedicated lock/unlock button. Next to it, there's a select with the following options: Lock, Lock with reduced guard, Unlock trunk.

To mimic this approach we could also have on lock entity and then a button that does the "Lock with reduced guard". Also, there is no way to tell afterwards how the car was locked. So the button could be a fit.

(Unlock trunk is not possible with the API.)

@gjohansson-ST
Copy link
Copy Markdown
Member

In the Volvo app there is one dedicated lock/unlock button. Next to it, there's a select with the following options: Lock, Lock with reduced guard, Unlock trunk.

To mimic this approach we could also have on lock entity and then a button that does the "Lock with reduced guard". Also, there is no way to tell afterwards how the car was locked. So the button could be a fit.

Initially I was thinking maybe a select entity for selecting the "mode" but probably not a bad idea to make a button instead for the reduced mode option and don't have to mess with a select entity.

@thomasddn thomasddn marked this pull request as draft October 30, 2025 09:03
@thomasddn
Copy link
Copy Markdown
Contributor Author

I have removed the "reduced guard" lock from this PR. I'll create a new PR later to add this "reduced guard" as a button.

@thomasddn thomasddn marked this pull request as ready for review October 30, 2025 10:06
Comment thread homeassistant/components/volvo/lock.py
Comment thread homeassistant/components/volvo/strings.json Outdated
Comment thread tests/components/volvo/test_lock.py Outdated
@thomasddn thomasddn marked this pull request as draft November 1, 2025 13:20
@thomasddn thomasddn marked this pull request as ready for review November 1, 2025 14:00
Copy link
Copy Markdown
Member

@gjohansson-ST gjohansson-ST left a comment

Choose a reason for hiding this comment

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

Thanks @thomasddn 👍

@gjohansson-ST gjohansson-ST merged commit 7145fb9 into home-assistant:dev Nov 2, 2025
36 checks passed
Comment thread homeassistant/components/volvo/strings.json
@thomasddn thomasddn deleted the volvo/feature/lock branch November 2, 2025 15:47
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants