history-explorer-card icon indicating copy to clipboard operation
history-explorer-card copied to clipboard

defaultTimeRange: allow to use any values

Open ildar170975 opened this issue 9 months ago • 0 comments

Consider the code:

type: custom:history-explorer-card
cardName: abcdef
graphs:
  - type: timeline
    entities:
      - entity: sun.sun
defaultTimeRange: 20h

Seems that currently the value of defaultTimeRange is kind of "filtered". For instance, instead of 20h another value (24h) is used.

Managed to fix this locally by forced calling setTimeRangeMinutes in setTimeRangeFromString. https://github.com/SpangleLabs/history-explorer-card/blob/f916a426227bed0926459045b5a667db44864751/src/history-explorer-card.js#L782 This allowed me to use even float values; this may be useful (for instance) to display a graph "starting from 00:00 till NOW".

ildar170975 avatar May 14 '24 22:05 ildar170975