From cc9e5de5031ddac20423d31d2d84086c9d5a9bbd Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 17 Dec 2016 13:00:08 -0800 Subject: [PATCH] Only report slowness warning once per entity (#4962) --- homeassistant/helpers/entity.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py index 87b05ded264..4137a31b8b6 100644 --- a/homeassistant/helpers/entity.py +++ b/homeassistant/helpers/entity.py @@ -79,6 +79,9 @@ class Entity(object): # Owning hass instance. Will be set by EntityComponent hass = None # type: Optional[HomeAssistant] + # If we reported if this entity was slow + _slow_reported = False + @property def should_poll(self) -> bool: """Return True if entity has to be polled for state. @@ -243,7 +246,8 @@ class Entity(object): end = timer() - if end - start > 0.4: + if not self._slow_reported and end - start > 0.4: + self._slow_reported = True _LOGGER.warning('Updating state for %s took %.3f seconds. ' 'Please report platform to the developers at ' 'https://goo.gl/Nvioub', self.entity_id,