Support additional fields from Brottsplatskartan API (headline, image, location_string etc.) #1770
Unanswered
markus-lassfolk
asked this question in
Integration enhancements
Replies: 1 comment
-
|
🏷️ I've automatically added the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Integration name
Brottsplatskartan
Link to integration documentation on our website
https://www.home-assistant.io/integrations/brottsplatskartan/
Describe the enhancement
The Brottsplatskartan integration currently only exposes the count of incidents and a breakdown of incident types. However, the underlying Brottsplatskartan API has been extended with many new useful fields (e.g.,
headline,image,image_far,content_teaser,location_string,location_string_2,date_human) which are not currently supported by the integration.I’d like to request that the integration be enhanced to surface these additional fields (for example as attributes or separate sensors) so users can display richer information (e.g., incident headline, teaser and image) inside Home Assistant.
Use cases
Background
The API updates by Brottsplatskartan state (in Swedish) here #https://brottsplatskartan.se/blogg/2024/uppdatering-api :
The current Python library and integration (via
brottsplatskartanPyPI package) appears to be built before these API additions (last release 2019) and thus the integration only supports minimal data.As a result, from within Home Assistant one currently sees only the number of incidents and no further detail (no headline, no summary, no image) — which limits usability and display options.
Proposal / Requested Enhancement
I propose the following enhancements to the Brottsplatskartan integration:
Extend the data model to parse the new API fields:
headline(string)content_teaser(string)imageand/orimage_far(URLs to images)location_string,location_string_2(text descriptions of location)date_human(human-friendly timestamp)Expose these fields in Home Assistant in a meaningful way:
extra_state_attributes, include the above fields for each incident (e.g., as a list of dicts)Make sure the fields are optional (since older API responses may not include them) and gracefully degrade if missing.
Documentation update: Update the integration’s doc (in
homeassistant/components/brottsplatskartan/manifest.json+ documentation on home-assistant.io) to indicate the availability of the new fields and how to access them.Benefits
Considerations / Questions
max_incidents) to control how many incident records to expose.entity_pictureand image URLs in attributes; we should follow best practices for exposing images (e.g., attributeentity_picture: <url>).Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions