Skip to content
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

Add 'focus' option to geo_location_sources for map card #22535

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

karwosts
Copy link
Contributor

@karwosts karwosts commented Oct 25, 2024

Proposed change

Map card entities have the focus option to exclude them from the auto-fit boundary, but geo_location_sources have no such option (so the fitBounds always wraps the entirety of all geo_location entities).

This PR adds the same focus option to geo_location_sources. As it is somewhat advanced (and not trivial to create UI for), the use of this option locks the card to yaml-only.

Can document on approval.

Type of change

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

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

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

This comment was marked as off-topic.

Copy link
Contributor

@MindFreeze MindFreeze left a comment

Choose a reason for hiding this comment

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

Having yaml only options is fine but we don't need to lock the card in yaml mode. The editor should handle the new object format and just not display the new option

@ildar170975
Copy link
Contributor

@karwosts
If geo location sources provide unavailable data and a zone is not home - then the Map card will show a home area due to #20722.

@karwosts
Copy link
Contributor Author

The editor should handle the new object format and just not display the new option

OK I updated to make this feature remain compatible with visual editor.

@MindFreeze
Copy link
Contributor

LGTM but please document it

@karwosts
Copy link
Contributor Author

docs added

@MindFreeze MindFreeze merged commit 42f2341 into home-assistant:dev Oct 29, 2024
15 checks passed
@karwosts karwosts deleted the map-geosource-focus branch October 29, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants