From 68e3c5c8c92b987a4bcfba97b4a8ed117e7dce73 Mon Sep 17 00:00:00 2001 From: iloveicedgreentea <31193909+iloveicedgreentea@users.noreply.github.com> Date: Fri, 13 Jan 2023 20:51:53 -0500 Subject: [PATCH] check lock --- madvr/madvr.py | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/madvr/madvr.py b/madvr/madvr.py index 9ab094c..163f131 100644 --- a/madvr/madvr.py +++ b/madvr/madvr.py @@ -379,6 +379,10 @@ def poll_status(self) -> None: """ Poll the status for attributes and write them to state """ + # If its locked, return + if not self._lock.acquire(blocking=False): # pylint: disable=consider-using-with + return + # lock so HA doesn't trip over itself with self._lock: try: diff --git a/setup.py b/setup.py index ad0ad03..2e3c7eb 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="py_madvr", - version="1.1.1", + version="1.1.2", author="iloveicedgreentea", description="A package to control MadVR Envy over IP", long_description=long_description,