From 9fe142a11491727ae4446e0f86f0df693594ede9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Fri, 24 Jul 2020 22:46:05 +0200 Subject: [PATCH] Prevent unnecessary updates of sun component (#38169) --- homeassistant/components/sun/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sun/__init__.py b/homeassistant/components/sun/__init__.py index c4692598447..fe89413f4d5 100644 --- a/homeassistant/components/sun/__init__.py +++ b/homeassistant/components/sun/__init__.py @@ -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)