diff options
author | Maxim Devaev <[email protected]> | 2021-09-08 06:08:11 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2021-09-08 06:08:11 +0300 |
commit | ca812117e48cbc6e2c71947b912748cfd3ff9691 (patch) | |
tree | d8daa43c9e606ed0c4226a112e943aa683fd627f /kvmd/plugins/ugpio/tesmart.py | |
parent | 5d1228eb9e5b159d0909453ed85280b9fb794a9e (diff) |
improved pins validation
Diffstat (limited to 'kvmd/plugins/ugpio/tesmart.py')
-rw-r--r-- | kvmd/plugins/ugpio/tesmart.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/plugins/ugpio/tesmart.py b/kvmd/plugins/ugpio/tesmart.py index 4bb2351b..ec513cf4 100644 --- a/kvmd/plugins/ugpio/tesmart.py +++ b/kvmd/plugins/ugpio/tesmart.py @@ -21,6 +21,7 @@ import asyncio +import functools from typing import Tuple from typing import Dict @@ -83,8 +84,8 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute } @classmethod - def get_pin_validator(cls) -> Callable[[Any], str]: - return (lambda arg: str(valid_number(arg, min=0, max=15, name="Tesmart channel"))) + def get_pin_validator(cls) -> Callable[[Any], Any]: + return functools.partial(valid_number, min=0, max=15, name="Tesmart channel") async def run(self) -> None: prev_active = -2 |