ianByrne / HASS-ukho_tides

Home Assistant integration for tide information
MIT License
27 stars 5 forks source link

Display tide predictions in an easier to read format #19

Open ianByrne opened 1 year ago

ianByrne commented 1 year ago

Currently the tide sensor has a predictions attribute which is made up of an array of arrays:

predictions: [ [ '2023-01-01 06:00:00', '1.6' ], [ '2023-01-01 13:00:00', '0.2' ] ]

Perhaps it can be refactored into something more meaningful, like an array of objects:

predictions:
  - datetime: 2023-01-01 06:00:00
    height: 1.6
    event: high tide
  - datetime: 2023-01-01 13:00:00
    height: 0.2
    event: low tide

Either refactored (causing breaking changes for anyone using the attribute), or as a new attribute for backwards compatibility.

As requested here. PRs welcome