Skip to content

Releases: 91JJ/HA_UK_Police

Home Assistant UK Police v1.1.1

07 Jun 19:13
e6e4757

Choose a tag to compare

Attempting to fix bug "value must be on of [1, 3, 6, 12]"

Home Assistant UK Police API v1.1

31 May 09:32
a0f5768

Choose a tag to compare

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), with full_description, url, and telephone
    in attributes.
  • Force Engagement Channels — exposes all social media and online contact channels
    as a count sensor, with a channels list and a flat links dict ({title: url}) in
    attributes for easy use in Lovelace templates and automations.
  • Force Telephone sensor now also includes engagement_methods in 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_grouped and _setup_individual now guard update_crimes/update_crime
    calls with a hass is not None check.
  • Removed unused PLATFORMS, OUTCOME_CATEGORIES, and STOP_SEARCH_OBJECT_TYPES
    constants from const.py.
  • Removed unused import homeassistant.helpers.config_validation as cv from
    config_flow.py.
  • Moved _strip_html helper in sensor.py to after the import block (was incorrectly
    defined before imports).

Home Assistant UK Police API

30 May 14:29
e828400

Choose a tag to compare

First release for Home Assistant.

Full Changelog: https://github.com/91JJ/HA_UK_Police/commits/1.0