Repository navigation
Conversation
…tage summary blueprint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 1 of 3 for
v0.7.0— adds persistent outage/exercise session tracking, a native Home Assistanteventplatform for generator lifecycle activity, and a bundled post-outage summary blueprint (addresses #216).v1 -> v2Storage Migration (readiness.py):StoretoSTORAGE_VERSION = 2via_ReadinessStore._async_migrate_func, migrating existingv1records transparently without resettingservice_baseline_hoursorlast_exercise_ts.unknownuntil a real run occurs.run_timeincreases between idle polls: short runs (within configured single-cycleexercise_minutes+ 5 min buffer, clamped to1–60min to ignore cumulative values, or<= 21min default) record an inferred exercise; longer deltas record an inferred outage with duration and estimated fuel used.fault_activeacross restarts so reloads never emit duplicate start/fault events or miss clearances.sensor.py):Last Outage(last_outage,SensorDeviceClass.TIMESTAMP)Last Exercise(last_exercise,SensorDeviceClass.TIMESTAMP)Last Outage Duration(last_outage_duration,SensorDeviceClass.DURATION,min,MEASUREMENT, withstarted_at,ended_at,run_hours_delta,estimated_fuel_used, andinferredattributes)eventPlatform (event.py,const.py,coordinator.py):eventtoPLATFORMS(configurable in Options across all 4 locales:en,fr,nb,pt).Activity(event.<generator>_activity,entity_key = "activity") emittingoutage_started,outage_ended,exercise_started,exercise_completed,fault_detected, andfault_clearedvia a bounded sequenced ring buffer onGeneracDataUpdateCoordinator(preventing spurious re-fires on unrelated listener notifications like maintenance timer resets, while replaying transitions discovered on initial refresh after a restart).generac_post_outage_summary.yaml):Runningoutage (ignoringExercisingcycles and surviving mid-outage flaps) to stabilize inReady, then sends an All Clear digest with outage duration, run hours added, estimated fuel used, optional propane autonomy, and hours until service.Testing
pytest --maxfail=3 --disable-warnings --color=yes --no-cov— 188 passed (Python 3.14.10,pytest-homeassistant-custom-component==0.13.375), including newtests/test_event.py,v1 -> v2migration & unobserved classification tests intests/test_readiness.py, session sensor tests intests/test_sensor.py, and end-to-end runtime execution tests forgenerac_post_outage_summary.yamlintests/test_blueprints.py.pre-commit run --all-files --show-diff-on-failure— all 8 hooks passed (flake8,reorder-python-imports,black,prettier, YAML/EOF/whitespace/large-file checks).