BottlecapDave / HomeAssistant-OctopusEnergy

Unofficial Home Assistant integration for interacting with Octopus Energy
https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/
MIT License
535 stars 50 forks source link

octopus_energy_octoplus_join_saving_session.yml: Add end date/time #787

Closed reedy closed 2 months ago

reedy commented 4 months ago

Fixes https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues/786

reedy commented 4 months ago

I wasn't sure about trying to use next_joined_event_duration_in_minutes, but it would seem "easier" if the event when fired included the duration (maybe?).

https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/blob/b06499c86548847b5c75c17a487a87178f59b64a/custom_components/octopus_energy/coordinators/saving_sessions.py#L73-L81

BottlecapDave commented 2 months ago

@reedy Thanks for the addition. The blueprint doesn't use the events so that it can recover if the registration API fails.

I think including the duration as part of the events would be better as it's unlikely that a session event would span multiple days. The docs would need to be updated as well.

BottlecapDave commented 2 months ago

This has been updated to include the duration in minutes, which is part of v10.3.0.