aex351 / home-assistant-neerslag-card

Display Buienalarm and/or Buienradar data in a graph for Home Assistant.
30 stars 3 forks source link

Configurable autozoom #21

Open Romkabouter opened 3 years ago

Romkabouter commented 3 years ago

Hi there,

I would like to opt for the autozoom to be a configuration set to on or off. Now, when there is autozoom and a light rain, in first glance it looks like heavy rain because the bar is way up. In my opinion it would be more easy to spot light or heavy rain with a fixed zoom

aex351 commented 3 years ago

I have added the option to disable autozoom (see readme file). Auto zoom can now be partially disabled by setting the autozoom configuration option to false.

Romkabouter commented 3 years ago

That was fast :D

aex351 commented 3 years ago

Functionality has been implemented. If there is any feedback. Feel free to share.

Romkabouter commented 3 years ago

In your documentation it says autozoom will be enable with extreme rainfail. It also seems to do so with no rainfall, is that expected behavior?

image

Romkabouter commented 3 years ago

Hmm, after a couple of reloads it works, it might be related to when no data is available, but I am not sure at the moment.

aex351 commented 3 years ago

No, if you disable autozoom by setting it to false, it will only autozoom when there is extreme rainfall. It won't autozoom when there is no data. This is because whenever there is extreme rainfall, the data pushes the y-axis boundary to make the data fit.

I think the underlying problem is the browser or mobile app caching mechanisme. I too experienced similar behavior in the mobile app. The graph was stuck on autozoom true (default). While the setting was autozoom false. Clearing the mobile app cache solved the issue.

The setting also doesn't get instantly reflected in the preview window of the Home Assistant card editor.

I will look in to this.

Romkabouter commented 3 years ago

I did a reload on the integration, I thought restarting Home Assistant would help but maybe not. I was updating HA, so assumed it would reload the integration.

Thanks for the feature, I have no further issues :)