Prevent unnecessary updates of sun component (#38169)

This commit is contained in:
Daniel Hjelseth Høyer
2020-07-24 22:46:05 +02:00
committed by GitHub
parent 8943954b18
commit 9fe142a114

View File

@@ -100,7 +100,10 @@ class Sun(Entity):
self._next_change = None self._next_change = None
def update_location(_event): def update_location(_event):
self.location = get_astral_location(self.hass) location = get_astral_location(self.hass)
if location == self.location:
return
self.location = location
self.update_events(dt_util.utcnow()) self.update_events(dt_util.utcnow())
update_location(None) update_location(None)