mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-02 11:01:53 +08:00
improved pins validation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user