0.4.0
What's New in 0.4.0
Three focused PRs landed since 0.2.0:
🗓️ Calendar entity (#79)
- New
calendar.hevy_<name>_workoutsentity exposes recent workouts asCalendarEvent. - Works out of the box with Lovelace calendar cards and
calendar.get_eventstriggers. - Each event includes title, duration, exercise count, total reps, and total volume in the description.
🎯 HA events for automations (#78)
- New
hevy_workout_completedevent fires every time a new workout appears in the cache. - New
hevy_workout_deletedevent fires when a cached workout disappears. - Payload:
id,title,start_time(ISO),duration_min,volume_kg,total_reps,exercise_count. - First refresh after startup is silent — events fire only for diffs against the previous poll.
- Unlocks one-liner automations like "play workout playlist when training starts" or "log volume to InfluxDB".
🧪 Test coverage expansion (#77)
- 68 new tests covering every sensor
value_fn/attributes_fnlambda, binary sensoris_on_fn, and entity classes (HevyEntity,HevyWorkoutEntity,HevySensor,HevyWorkoutDateSensor,HevyExerciseSensor). - Total suite now 135 passing in ~0.1s, no
pytest-homeassistant-custom-componentdependency required (lightweight HA stubs).
📖 README overhaul (#80)
- Full entity reference matrix grouped by category (aggregates, binary, per-workout, calendar) with units and descriptions.
- Events section documenting
hevy_workout_completed/hevy_workout_deletedpayloads. - Automation cookbook: 5 copy-paste examples (post-workout notification, playlist trigger, streak alert, weekly volume gauge, calendar card).
- Polling behaviour explained.
- Troubleshooting table.
- Calls out Hevy Pro requirement up-front.
Internals
- Coordinator now exposes pure helpers (
_event_payload,_workout_event,_fire_workout_events) for testability. Platform.CALENDARadded alongsideSENSOR+BINARY_SENSOR.- en + pt-BR translations updated with calendar entity name.
Full diff: v0.2.0...v0.4.0