Skip to content

0.4.0

Choose a tag to compare

@hudsonbrendon hudsonbrendon released this 17 May 23:57
24183bd

What's New in 0.4.0

Three focused PRs landed since 0.2.0:

🗓️ Calendar entity (#79)

  • New calendar.hevy_<name>_workouts entity exposes recent workouts as CalendarEvent.
  • Works out of the box with Lovelace calendar cards and calendar.get_events triggers.
  • Each event includes title, duration, exercise count, total reps, and total volume in the description.

🎯 HA events for automations (#78)

  • New hevy_workout_completed event fires every time a new workout appears in the cache.
  • New hevy_workout_deleted event 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_fn lambda, binary sensor is_on_fn, and entity classes (HevyEntity, HevyWorkoutEntity, HevySensor, HevyWorkoutDateSensor, HevyExerciseSensor).
  • Total suite now 135 passing in ~0.1s, no pytest-homeassistant-custom-component dependency 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_deleted payloads.
  • 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.CALENDAR added alongside SENSOR + BINARY_SENSOR.
  • en + pt-BR translations updated with calendar entity name.

Full diff: v0.2.0...v0.4.0