Releases: 91JJ/HA_UK_Police
Home Assistant UK Police v1.1.1
Home Assistant UK Police API v1.1
v1.1.0
What's New
Smart data refresh
The integration previously polled all API endpoints every hour. UK Police data is only
published roughly every 2 months, so this was unnecessary load on both HA and the API.
The coordinator now wakes up once per day and makes a single lightweight call to
crime-last-updated. If the published date hasn't changed, the full fetch is skipped
entirely and all sensors retain their cached values. A full fetch only runs when new
data is actually available. Manual refresh is still available via the uk_police.refresh
service at any time.
Force detail sensors (2 new)
- Force Description — surfaces the full force description text as a sensor state
(truncated to 255 chars for HA state), withfull_description,url, andtelephone
in attributes. - Force Engagement Channels — exposes all social media and online contact channels
as a count sensor, with achannelslist and a flatlinksdict ({title: url}) in
attributes for easy use in Lovelace templates and automations. - Force Telephone sensor now also includes
engagement_methodsin its attributes.
Per-location geo_location source
Previously all crime map pins shared the source uk_police, making it impossible to
filter pins by location on a Lovelace map card. Each configured area now gets its own
source in the format uk_police_{force}_{neighbourhood} (e.g.
uk_police_metropolitan_E05013580), with hyphens normalised to underscores. The exact
value is visible on any geo_location entity's source attribute.
Bug fixes
- Fixed crash (
RuntimeError: Attribute hass is None) on second location setup caused
by geo_location update callbacks being fired before entities were registered with HA.
Both_setup_groupedand_setup_individualnow guardupdate_crimes/update_crime
calls with ahass is not Nonecheck. - Removed unused
PLATFORMS,OUTCOME_CATEGORIES, andSTOP_SEARCH_OBJECT_TYPES
constants fromconst.py. - Removed unused
import homeassistant.helpers.config_validation as cvfrom
config_flow.py. - Moved
_strip_htmlhelper insensor.pyto after the import block (was incorrectly
defined before imports).
Home Assistant UK Police API
First release for Home Assistant.
Full Changelog: https://github.com/91JJ/HA_UK_Police/commits/1.0