diff options
author | Maxim Devaev <[email protected]> | 2022-08-07 19:04:32 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-08-07 19:04:32 +0300 |
commit | ec9785b4be4afb8667e6968a0454aeca62a190e2 (patch) | |
tree | 0b5c7d1b03041867c78f5533a8dd8f488711b073 /kvmd/plugins/ugpio | |
parent | aa630988cc09f31d412a62c5480d4bec1a7c626e (diff) |
simplified AioNotifier()
Diffstat (limited to 'kvmd/plugins/ugpio')
-rw-r--r-- | kvmd/plugins/ugpio/ezcoo.py | 2 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/hidrelay.py | 2 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/hue.py | 4 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/ipmi.py | 2 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/otgconf.py | 6 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/pway.py | 2 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/tesmart.py | 4 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/xh_hk4401.py | 2 |
8 files changed, 12 insertions, 12 deletions
diff --git a/kvmd/plugins/ugpio/ezcoo.py b/kvmd/plugins/ugpio/ezcoo.py index 3cfc2e05..ac7ee0f3 100644 --- a/kvmd/plugins/ugpio/ezcoo.py +++ b/kvmd/plugins/ugpio/ezcoo.py @@ -101,7 +101,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute (got, channel) = await aiomulti.queue_get_last(self.__channel_queue, 1) if got and self.__channel != channel: self.__channel = channel - await self._notifier.notify() + self._notifier.notify() async def cleanup(self) -> None: if self.__proc is not None: diff --git a/kvmd/plugins/ugpio/hidrelay.py b/kvmd/plugins/ugpio/hidrelay.py index 1dce0909..d1786908 100644 --- a/kvmd/plugins/ugpio/hidrelay.py +++ b/kvmd/plugins/ugpio/hidrelay.py @@ -109,7 +109,7 @@ class Plugin(BaseUserGpioDriver): except Exception: raw = -1 if raw != prev_raw: - await self._notifier.notify() + self._notifier.notify() prev_raw = raw await asyncio.sleep(self.__state_poll) diff --git a/kvmd/plugins/ugpio/hue.py b/kvmd/plugins/ugpio/hue.py index f81df4ca..b34cb719 100644 --- a/kvmd/plugins/ugpio/hue.py +++ b/kvmd/plugins/ugpio/hue.py @@ -122,7 +122,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute get_logger().error("Failed Hue bulk GET request: %s", tools.efmt(err)) self.__state = dict.fromkeys(self.__state, None) if self.__state != prev_state: - await self._notifier.notify() + self._notifier.notify() prev_state = self.__state await self.__update_notifier.wait(self.__state_poll) @@ -148,7 +148,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute get_logger().error("Failed Hue PUT request to pin %s: %s", pin, tools.efmt(err)) raise GpioDriverOfflineError(self) else: - await self.__update_notifier.notify() + self.__update_notifier.notify() def __ensure_http_session(self) -> aiohttp.ClientSession: if not self.__http_session: diff --git a/kvmd/plugins/ugpio/ipmi.py b/kvmd/plugins/ugpio/ipmi.py index 65c7efdf..e822065d 100644 --- a/kvmd/plugins/ugpio/ipmi.py +++ b/kvmd/plugins/ugpio/ipmi.py @@ -135,7 +135,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute await self.__update_power() new = (self.__online, self.__power) if new != prev: - await self._notifier.notify() + self._notifier.notify() prev = new await asyncio.sleep(self.__state_poll) diff --git a/kvmd/plugins/ugpio/otgconf.py b/kvmd/plugins/ugpio/otgconf.py index efe1b5c4..28eae8fe 100644 --- a/kvmd/plugins/ugpio/otgconf.py +++ b/kvmd/plugins/ugpio/otgconf.py @@ -76,7 +76,7 @@ class Plugin(BaseUserGpioDriver): while True: try: while True: - await self._notifier.notify() + self._notifier.notify() if os.path.isfile(self.__udc_path): break await asyncio.sleep(5) @@ -84,7 +84,7 @@ class Plugin(BaseUserGpioDriver): with Inotify() as inotify: inotify.watch(os.path.dirname(self.__udc_path), InotifyMask.ALL_MODIFY_EVENTS) inotify.watch(self.__profile_path, InotifyMask.ALL_MODIFY_EVENTS) - await self._notifier.notify() + self._notifier.notify() while True: need_restart = False need_notify = False @@ -97,7 +97,7 @@ class Plugin(BaseUserGpioDriver): if need_restart: break if need_notify: - await self._notifier.notify() + self._notifier.notify() except Exception: logger.exception("Unexpected OTG-bind watcher error") await asyncio.sleep(1) diff --git a/kvmd/plugins/ugpio/pway.py b/kvmd/plugins/ugpio/pway.py index 041aaf27..969838f3 100644 --- a/kvmd/plugins/ugpio/pway.py +++ b/kvmd/plugins/ugpio/pway.py @@ -103,7 +103,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute (got, channel) = await aiomulti.queue_get_last(self.__channel_queue, 1) if got and self.__channel != channel: self.__channel = channel - await self._notifier.notify() + self._notifier.notify() async def cleanup(self) -> None: if self.__proc is not None: diff --git a/kvmd/plugins/ugpio/tesmart.py b/kvmd/plugins/ugpio/tesmart.py index 288f2133..e3f5a3bd 100644 --- a/kvmd/plugins/ugpio/tesmart.py +++ b/kvmd/plugins/ugpio/tesmart.py @@ -111,7 +111,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute except Exception: pass if self.__active != prev_active: - await self._notifier.notify() + self._notifier.notify() prev_active = self.__active await self.__update_notifier.wait(self.__state_poll) @@ -127,7 +127,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute assert 1 <= channel <= 16 if state: await self.__send_command("{:c}{:c}".format(1, channel).encode()) - await self.__update_notifier.notify() + self.__update_notifier.notify() await asyncio.sleep(self.__switch_delay) # Slowdown # ===== diff --git a/kvmd/plugins/ugpio/xh_hk4401.py b/kvmd/plugins/ugpio/xh_hk4401.py index 53582897..d2ed34a5 100644 --- a/kvmd/plugins/ugpio/xh_hk4401.py +++ b/kvmd/plugins/ugpio/xh_hk4401.py @@ -99,7 +99,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute (got, channel) = await aiomulti.queue_get_last(self.__channel_queue, 1) if got and self.__channel != channel: self.__channel = channel - await self._notifier.notify() + self._notifier.notify() async def cleanup(self) -> None: if self.__proc is not None: |