diff options
author | Maxim Devaev <[email protected]> | 2022-09-04 18:08:40 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-09-04 18:08:40 +0300 |
commit | ee3e224e396494cd0d69bb6167087a071a20349c (patch) | |
tree | 5becd28570e58a03c6e1e231d0db24c264a73f88 /kvmd/plugins/ugpio/__init__.py | |
parent | 4b75221e9470b4a009955d7677f16adf8e23e302 (diff) |
new typing style
Diffstat (limited to 'kvmd/plugins/ugpio/__init__.py')
-rw-r--r-- | kvmd/plugins/ugpio/__init__.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kvmd/plugins/ugpio/__init__.py b/kvmd/plugins/ugpio/__init__.py index 54ee2aea..f5bee635 100644 --- a/kvmd/plugins/ugpio/__init__.py +++ b/kvmd/plugins/ugpio/__init__.py @@ -20,10 +20,7 @@ # ========================================================================== # -from typing import Set -from typing import Type from typing import Callable -from typing import Optional from typing import Any from ...errors import OperationError @@ -71,7 +68,7 @@ class BaseUserGpioDriver(BasePlugin): return self._instance_name @classmethod - def get_modes(cls) -> Set[str]: + def get_modes(cls) -> set[str]: return set(UserGpioModes.ALL) @classmethod @@ -84,7 +81,7 @@ class BaseUserGpioDriver(BasePlugin): _ = pin _ = debounce - def register_output(self, pin: str, initial: Optional[bool]) -> None: + def register_output(self, pin: str, initial: (bool | None)) -> None: _ = pin _ = initial @@ -105,5 +102,5 @@ class BaseUserGpioDriver(BasePlugin): # ===== -def get_ugpio_driver_class(name: str) -> Type[BaseUserGpioDriver]: +def get_ugpio_driver_class(name: str) -> type[BaseUserGpioDriver]: return get_plugin_class("ugpio", name) # type: ignore |