Skip to content

Add device_tracker platform to Volvo integration#153437

Merged
joostlek merged 10 commits into
home-assistant:devfrom
thomasddn:volvo/feature/device-tracker
Oct 10, 2025
Merged

Add device_tracker platform to Volvo integration#153437
joostlek merged 10 commits into
home-assistant:devfrom
thomasddn:volvo/feature/device-tracker

Conversation

@thomasddn
Copy link
Copy Markdown
Contributor

@thomasddn thomasddn commented Oct 2, 2025

Proposed change

Add device_tracker platform to Volvo integration. A direction sensor has also been added.

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:

@sillymoi
Copy link
Copy Markdown

sillymoi commented Oct 2, 2025

FWIW, did a quick check on my installation and it worked fine.

@thomasddn thomasddn marked this pull request as ready for review October 2, 2025 13:36
@thomasddn thomasddn closed this Oct 5, 2025
@thomasddn thomasddn deleted the volvo/feature/device-tracker branch October 5, 2025 12:02
@thomasddn thomasddn restored the volvo/feature/device-tracker branch October 5, 2025 12:02
@mib1185 mib1185 reopened this Oct 5, 2025
Comment thread homeassistant/components/volvo/coordinator.py
Comment thread homeassistant/components/volvo/device_tracker.py
Comment thread homeassistant/components/volvo/device_tracker.py Outdated
Comment thread homeassistant/components/volvo/sensor.py Outdated
Comment thread homeassistant/components/volvo/device_tracker.py Outdated
Comment thread homeassistant/components/volvo/device_tracker.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft October 6, 2025 13:21
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Oct 6, 2025

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.

@thomasddn thomasddn marked this pull request as ready for review October 6, 2025 15:06
Comment thread homeassistant/components/volvo/coordinator.py Outdated
Comment thread homeassistant/components/volvo/sensor.py Outdated
@@ -380,13 +400,12 @@ def _update_state(self, api_field: VolvoCarsApiBaseModel | None) -> None:
self._attr_native_value = None
return

assert isinstance(api_field, VolvoCarsValue)
native_value = None
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a bit trouble to understand why you assign this variable, whilst it will be outputted later on directly to self._attr_native_value. Can't the _attr be used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm using a variable, because in the statements below, the value could still be transformed before it is assigned to self._attr_native_value. It's probably personal taste, but I like that better than throwing self._attr_native_value everywhere around. 😄

I could move the whole block to a method if you'd prefer that.

@thomasddn thomasddn marked this pull request as draft October 10, 2025 07:43
@thomasddn thomasddn marked this pull request as ready for review October 10, 2025 08:39
@home-assistant home-assistant Bot requested a review from erwindouna October 10, 2025 08:39
@joostlek joostlek merged commit c7321a3 into home-assistant:dev Oct 10, 2025
34 checks passed
@thomasddn thomasddn deleted the volvo/feature/device-tracker branch October 10, 2025 15:27
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 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.

5 participants