Skip to content

Releases: Geek-MD/USGS_Quakes

v1.2.7

16 Mar 23:32
c740dec

Choose a tag to compare

Added

  • usgs_earthquakes_feed_new_events HA event: The sensor now fires this event on the HA event bus every time new earthquake events are detected. Automations can use trigger: platform: event / event_type: usgs_earthquakes_feed_new_events to react instantly. The event payload contains entry_id, count (number of new events), and events (the list of new event dicts).
  • EVENT_NEW_QUAKES constant added to const.py to hold the event name.

Fixed

  • README: Updated sensor description to reflect the latest_events delta semantics introduced in v1.2.6 (removed references to the old events attribute and the "last 50 events" cap). Added full documentation for the new HA event and an example automation.

Fixed

  • Conceptual error in v1.2.5: latest_events was incorrectly made a cumulative list that grew on every update, always containing all historical events. The correct behaviour is:
    • latest_events contains only the new events detected in the current update cycle (events whose IDs have not been seen before).
    • On the first run (or after HA restarts), all events returned by the feed are considered new, so latest_events is populated with all of them.
    • On subsequent runs where no new earthquakes have been reported, latest_events is empty ([]), the sensor state does not change, and automations that trigger on state change are not fired.
    • When a new earthquake is detected, latest_events contains only that event (or those events), the sensor state updates to the most recent event's timestamp, and the automation is triggered.

Changed

  • Replaced the cumulative _latest_events accumulator with an internal _seen_ids: set[str] that tracks which event IDs have already been reported. This is not exposed as a sensor attribute.
  • Removed the now-unused MAX_EVENTS constant from sensor.py.

v1.2.4

16 Mar 01:10
255444e

Choose a tag to compare

Fixed

  • OptionsFlowHandler no longer raises AttributeError on reconfiguration: Removed the __init__ method from OptionsFlowHandler that tried to set self.config_entry = config_entry. In newer versions of Home Assistant, config_entry is a read-only property on OptionsFlow and is automatically injected by the framework. The async_get_options_flow method now returns OptionsFlowHandler() without passing config_entry manually.

v1.2.3

15 Mar 22:07
b374b68

Choose a tag to compare

Fixed

  • Redundant lambda wrappers removed from sensor.py: Both sorted() calls that used key=lambda e: parse_event_time(e) now use key=parse_event_time directly, as suggested by code review.
  • parse_event_time now handles event dicts: Updated helpers.py so that parse_event_time correctly extracts the "time" field when passed a full event dict, allowing it to be used directly as a sort key without an intermediate lambda.

v1.2.2

15 Mar 21:51
38633c3

Choose a tag to compare

Fixed

  • Restored latest_events attribute: The sensor's extra_state_attributes now includes a latest_events key that was inadvertently removed in v1.2.1.
    • On the first update, latest_events contains all events reported by the integration, ordered from most recent to oldest.
    • On subsequent updates, latest_events contains only the new events since the previous update, ordered from most recent to oldest.

Changed

  • format_events service now reads from latest_events: The format_events action now formats events sourced from the latest_events attribute (new events only per update) instead of the full cumulative events list.

v1.2.1

15 Mar 21:17
b9a7237

Choose a tag to compare

Fixed

  • Sensor state "unknown": The sensor state was incorrectly showing unknown even when events were present. The root cause was that entry.time from aio_geojson_usgs_earthquakes is a datetime object, and the code tried to call .replace("Z", "+00:00") on it as if it were a string. datetime.replace() does not accept positional string arguments, causing a TypeError that was silently caught and left _attr_native_value as None.
  • Removed erroneous @callback decorator from async def _async_update_events in sensor.py (correct pattern for async dispatcher callbacks).

Changed

  • Removed formatted_events attribute from the sensor's extra_state_attributes.
  • Added new format_events action (service) that returns formatted earthquake events in a response variable (formatted_events). Call this action with a response_variable to get the human-readable text output.

v1.2.0

15 Mar 05:53
c820a82

Choose a tag to compare

Changed

  • Changed integration domain from usgs_quakes to usgs_earthquakes_feed to override the built-in HA core integration of the same name
  • Kept integration name as "USGS Quakes"
  • Renamed custom_components/usgs_quakes/ folder to custom_components/usgs_earthquakes_feed/
  • Updated manifest.json, hacs.json, mypy.ini, and GitHub Actions workflow to reflect new domain
  • Updated README.md references to new domain and sensor/service names
  • Updated STORAGE_KEY and device identifiers to use usgs_earthquakes_feed
  • Brand images remain in custom_components/usgs_earthquakes_feed/brand/ for local brand image support
  • Updated README.md with a prominent notice about the core integration override and a migration guide for users upgrading from usgs_quakes (v1.1.x)

v1.1.5

15 Mar 05:31
36b7eb4

Choose a tag to compare

Changed

  • Moved logo.png, logo@2x.png, icon.png, and icon@2x.png to custom_components/usgs_quakes/brand/
  • Updated README.md icon image link to reference new brand directory location

v1.1.4

11 Dec 02:25
51b714a

Choose a tag to compare

Fixed

  • Critical: Added missing OptionsFlowHandler class to enable configuration changes through the UI
    • Users can now modify Radius, Minimum Magnitude, and Feed Type after initial setup
    • Fixed integration reload when options are updated

Changed

  • Enhanced README badge section with additional quality indicators
    • Added Ruff + Mypy + Hassfest combined workflow badge
    • Added Ruff quality badge
    • Added Mypy type checking badge
  • Added "Proudly developed with GitHub Copilot" footer to README
  • All badges now properly reference USGS_Quakes repository

Quality

  • Verified code passes all ruff linting checks
  • Verified code passes all mypy type checks
  • No code errors found - all Python files are compliant with configured standards

v1.1.3

20 Oct 18:08
6c0b0ea

Choose a tag to compare

📦 USGS Quakes v1.1.3 (2025-10-20)

Enhancements:

  • 🕒 Improved timestamp handling: The sensor.usgs_quakes_latest now displays the latest earthquake's timestamp in local time instead of UTC.
  • 🌐 The formatted_events attribute also reflects local time for each event, enhancing readability in Lovelace cards and automations.

Notes:

  • ✅ This improves consistency with Home Assistant’s timestamp sensors, which expect localized values.
  • 📘 No breaking changes — existing automations and cards will continue to work as expected.

v1.1.2

20 Oct 15:15
c87f447

Choose a tag to compare

📦 USGS Quakes v1.1.2 (2025-10-20)

Enhancements:

  • 🆔 Sensor sensor.usgs_quakes_latest now explicitly sets _attr_suggested_object_id to ensure consistent entity ID creation across new installations.
  • 🧠 Improved internal clarity by defining both SENSOR_NAME and SENSOR_UNIQUE_ID as constants for better reuse and readability.

Bugfixes:

  • 🐛 Fixed an issue where some users saw the sensor created with an incorrect entity ID (e.g., sensor.usgs_quakes_feed_usgs_quakes_latest) due to residual naming from early versions.

Notes:

  • 🔄 If you're still seeing the old sensor ID, you may need to remove and re-add the integration after updating to this version.