Prevent unnecessary updates of sun component (#38169)

This commit is contained in:
Daniel Hjelseth Høyer authored and GitHub committed 2020-07-24 10:46:05 -10:00
1 parent 8943954b18
commit 9fe142a114
1 file changed
+4 -1
+4 -1
View File
@@ -100,7 +100,10 @@ class Sun(Entity):
self._next_change = None
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())
update_location(None)