HandyHat / ha-hildebrandglow-dcc

Home Assistant integration for UK SMETS (Smart) meters pulling data from the DCC via the Hildebrand Glow API
MIT License
233 stars 34 forks source link

Sum the second value returned from pyglowmarkt if it exist. #331

Closed eknirk closed 1 year ago

eknirk commented 1 year ago

Description

A change in how pyglowmarkt handles timezones causes two values to be returned most of the times instead of a single value.

Motivation and Context

The above change in pyglowmarkt was not reflected and only the first value was used, which only contained data from the first our of the day. This is described in issue #330 and this PR fixes the issue.

How Has This Been Tested?

The fix has been tested on my own live system.

Types of changes

HandyHat commented 1 year ago

This is obviously not the "right" way to fix this (the right way would be to handle daylight savings properly and only ask for today's data) but in the interest of getting this integration working again, I am happy to merge this and release a new version. Thank you so much for the PR @eknirk!

eknirk commented 1 year ago

The “right” way would probably get the change in pyglowmarkt reversed as I cannot think of a way that this can be done in ha-hildebrandglow-dcc alone.

On 19 Apr 2023, at 20:58, Aniket @.***> wrote:

This is obviously not the "right" way to fix this (the right way would be to handle daylight savings properly and only ask for today's data) but in the interest of getting this integration working again, I am happy to merge this and release a new version. Thank you so much for the PR @eknirk https://github.com/eknirk!

— Reply to this email directly, view it on GitHub https://github.com/HandyHat/ha-hildebrandglow-dcc/pull/331#issuecomment-1515300751, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQOYHDXD3SFTHAXDCHONO3LXCA7WFANCNFSM6AAAAAAXCQGT2Y. You are receiving this because you were mentioned.

chesterflaps commented 1 year ago

Can I just ask, do I just copy the code under the heading changed filed and paste it over the top of what is in my config file on HA?

I've not dealt with a pull request before.