Skip to content

Commit

Permalink
Merge pull request #121 from BenPru/BenPru-fix-missing-sensor-updates
Browse files Browse the repository at this point in the history
Update base.py
  • Loading branch information
BenPru authored Sep 12, 2023
2 parents 2ef45b2 + 17731cf commit 3d3b55a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/luxtronik/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _handle_coordinator_update(self) -> None:

self._enrich_extra_attributes()

if descr.update_interval is not None:
if descr.update_interval is not None and (self.next_update is None or self.next_update < utcnow()):
self.next_update = utcnow() + descr.update_interval
super()._handle_coordinator_update()

Expand Down

4 comments on commit 3d3b55a

@marcelhen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BenPru. Many thanks for the update but the problem is the same, No updates at "sensor.luxtronik2_outdoor_temperature"

Best regards

@marcelhen
Copy link

@marcelhen marcelhen commented on 3d3b55a Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BenPru,

I have change your configuration and is shows good, all Sensors updated permanently.
I think it´s a problem with the "utcnow" in Line 142 & 143 and with the "not" in Line 142

My code:

    if descr.update_interval is None:
        self.next_update = descr.update_interval
    super()._handle_coordinator_update()

I hope is usefull for your configuration...

Best regards Marcel

@BenPru
Copy link
Owner Author

@BenPru BenPru commented on 3d3b55a Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have change your configuration and is shows good, all Sensors updated permanently. I think it´s a problem with the "utcnow" in Line 142 & 143 and with the "not" in Line 142
if descr.update_interval is None:
self.next_update = descr.update_interval

Your code sets the next_update always to None and so the senors are updated always immediately.
My code works perfect for me, with the last change.
image

I push the current code to the branch.

@marcelhen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BenPru,

after I updated to "2023.9.20-Alpha-Core-Preview" it runs perfectly. The outdoor temperature and all other sensors are updated perfectly.

Thanks for your super job!!!!!

Please sign in to comment.