Releases: Geek-MD/USGS_Quakes
Releases · Geek-MD/USGS_Quakes
v1.2.7
Added
usgs_earthquakes_feed_new_eventsHA event: The sensor now fires this event on the HA event bus every time new earthquake events are detected. Automations can usetrigger: platform: event / event_type: usgs_earthquakes_feed_new_eventsto react instantly. The event payload containsentry_id,count(number of new events), andevents(the list of new event dicts).EVENT_NEW_QUAKESconstant added toconst.pyto hold the event name.
Fixed
- README: Updated sensor description to reflect the
latest_eventsdelta semantics introduced in v1.2.6 (removed references to the oldeventsattribute 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_eventswas incorrectly made a cumulative list that grew on every update, always containing all historical events. The correct behaviour is:latest_eventscontains 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_eventsis populated with all of them. - On subsequent runs where no new earthquakes have been reported,
latest_eventsis empty ([]), the sensor state does not change, and automations that trigger on state change are not fired. - When a new earthquake is detected,
latest_eventscontains 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_eventsaccumulator 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_EVENTSconstant fromsensor.py.
v1.2.4
Fixed
OptionsFlowHandlerno longer raisesAttributeErroron reconfiguration: Removed the__init__method fromOptionsFlowHandlerthat tried to setself.config_entry = config_entry. In newer versions of Home Assistant,config_entryis a read-only property onOptionsFlowand is automatically injected by the framework. Theasync_get_options_flowmethod now returnsOptionsFlowHandler()without passingconfig_entrymanually.
v1.2.3
Fixed
- Redundant lambda wrappers removed from
sensor.py: Bothsorted()calls that usedkey=lambda e: parse_event_time(e)now usekey=parse_event_timedirectly, as suggested by code review. parse_event_timenow handles event dicts: Updatedhelpers.pyso thatparse_event_timecorrectly 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
Fixed
- Restored
latest_eventsattribute: The sensor'sextra_state_attributesnow includes alatest_eventskey that was inadvertently removed in v1.2.1.- On the first update,
latest_eventscontains all events reported by the integration, ordered from most recent to oldest. - On subsequent updates,
latest_eventscontains only the new events since the previous update, ordered from most recent to oldest.
- On the first update,
Changed
format_eventsservice now reads fromlatest_events: Theformat_eventsaction now formats events sourced from thelatest_eventsattribute (new events only per update) instead of the full cumulativeeventslist.
v1.2.1
Fixed
- Sensor state "unknown": The sensor state was incorrectly showing
unknowneven when events were present. The root cause was thatentry.timefromaio_geojson_usgs_earthquakesis adatetimeobject, 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 aTypeErrorthat was silently caught and left_attr_native_valueasNone. - Removed erroneous
@callbackdecorator fromasync def _async_update_eventsinsensor.py(correct pattern for async dispatcher callbacks).
Changed
- Removed
formatted_eventsattribute from the sensor'sextra_state_attributes. - Added new
format_eventsaction (service) that returns formatted earthquake events in a response variable (formatted_events). Call this action with aresponse_variableto get the human-readable text output.
v1.2.0
Changed
- Changed integration domain from
usgs_quakestousgs_earthquakes_feedto override the built-in HA core integration of the same name - Kept integration name as "USGS Quakes"
- Renamed
custom_components/usgs_quakes/folder tocustom_components/usgs_earthquakes_feed/ - Updated
manifest.json,hacs.json,mypy.ini, and GitHub Actions workflow to reflect new domain - Updated
README.mdreferences to new domain and sensor/service names - Updated
STORAGE_KEYand device identifiers to useusgs_earthquakes_feed - Brand images remain in
custom_components/usgs_earthquakes_feed/brand/for local brand image support - Updated
README.mdwith a prominent notice about the core integration override and a migration guide for users upgrading fromusgs_quakes(v1.1.x)
v1.1.5
Changed
- Moved
logo.png,logo@2x.png,icon.png, andicon@2x.pngtocustom_components/usgs_quakes/brand/ - Updated README.md icon image link to reference new brand directory location
v1.1.4
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
📦 USGS Quakes v1.1.3 (2025-10-20)
Enhancements:
- 🕒 Improved timestamp handling: The
sensor.usgs_quakes_latestnow displays the latest earthquake's timestamp in local time instead of UTC. - 🌐 The
formatted_eventsattribute 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
📦 USGS Quakes v1.1.2 (2025-10-20)
Enhancements:
- 🆔 Sensor
sensor.usgs_quakes_latestnow explicitly sets_attr_suggested_object_idto ensure consistent entity ID creation across new installations. - 🧠 Improved internal clarity by defining both
SENSOR_NAMEandSENSOR_UNIQUE_IDas 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.