mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Use cache update for WIFI blinds (#108224)
This commit is contained in:
parent
274d501bca
commit
154fe8631a
@ -5,7 +5,7 @@ import logging
|
|||||||
from socket import timeout
|
from socket import timeout
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from motionblinds import ParseException
|
from motionblinds import DEVICE_TYPES_WIFI, ParseException
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
@ -59,7 +59,9 @@ class DataUpdateCoordinatorMotionBlinds(DataUpdateCoordinator):
|
|||||||
def update_blind(self, blind):
|
def update_blind(self, blind):
|
||||||
"""Fetch data from a blind."""
|
"""Fetch data from a blind."""
|
||||||
try:
|
try:
|
||||||
if self._wait_for_push:
|
if blind.device_type in DEVICE_TYPES_WIFI:
|
||||||
|
blind.Update_from_cache()
|
||||||
|
elif self._wait_for_push:
|
||||||
blind.Update()
|
blind.Update()
|
||||||
else:
|
else:
|
||||||
blind.Update_trigger()
|
blind.Update_trigger()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user