Removed unnecessary dps from covers; reduced cache timeout for covers and lights
This commit is contained in:
@@ -88,8 +88,6 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
pytuyadevice.set_version(float(config.get(CONF_PROTOCOL_VERSION)))
|
pytuyadevice.set_version(float(config.get(CONF_PROTOCOL_VERSION)))
|
||||||
dps = {}
|
dps = {}
|
||||||
dps[config.get(CONF_ID)]=None
|
dps[config.get(CONF_ID)]=None
|
||||||
dps["101"]=None
|
|
||||||
dps["102"]=None
|
|
||||||
pytuyadevice.set_dpsUsed(dps)
|
pytuyadevice.set_dpsUsed(dps)
|
||||||
|
|
||||||
cover_device = TuyaCoverCache(pytuyadevice)
|
cover_device = TuyaCoverCache(pytuyadevice)
|
||||||
@@ -163,7 +161,7 @@ class TuyaCoverCache:
|
|||||||
self._lock.acquire()
|
self._lock.acquire()
|
||||||
try:
|
try:
|
||||||
now = time()
|
now = time()
|
||||||
if not self._cached_status or now - self._cached_status_time > 30:
|
if not self._cached_status or now - self._cached_status_time > 15:
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
self._cached_status = self.__get_status()
|
self._cached_status = self.__get_status()
|
||||||
self._cached_status_time = time()
|
self._cached_status_time = time()
|
||||||
|
@@ -124,7 +124,7 @@ class TuyaCache:
|
|||||||
self._lock.acquire()
|
self._lock.acquire()
|
||||||
try:
|
try:
|
||||||
now = time()
|
now = time()
|
||||||
if not self._cached_status or now - self._cached_status_time > 30:
|
if not self._cached_status or now - self._cached_status_time > 15:
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
self._cached_status = self.__get_status(switchid)
|
self._cached_status = self.__get_status(switchid)
|
||||||
self._cached_status_time = time()
|
self._cached_status_time = time()
|
||||||
|
Reference in New Issue
Block a user