Skip to content

Commit 8a54f8d

Browse files
joostlekfrenck
authored andcommitted
Throttle Decora wifi updates (home-assistant#156994)
1 parent 5c27126 commit 8a54f8d

File tree

1 file changed

+3
-0
lines changed
  • homeassistant/components/decora_wifi

1 file changed

+3
-0
lines changed

homeassistant/components/decora_wifi/light.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from datetime import timedelta
56
import logging
67
from typing import Any
78

@@ -25,6 +26,7 @@
2526
from homeassistant.helpers import config_validation as cv
2627
from homeassistant.helpers.entity_platform import AddEntitiesCallback
2728
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
29+
from homeassistant.util import Throttle
2830

2931
_LOGGER = logging.getLogger(__name__)
3032

@@ -167,6 +169,7 @@ def turn_off(self, **kwargs: Any) -> None:
167169
except ValueError:
168170
_LOGGER.error("Failed to turn off myLeviton switch")
169171

172+
@Throttle(timedelta(seconds=30))
170173
def update(self) -> None:
171174
"""Fetch new state data for this switch."""
172175
try:

0 commit comments

Comments
 (0)