string pins

This commit is contained in:
Maxim Devaev
2021-09-08 05:43:36 +03:00
parent 939c63fe7d
commit 98ad1145a8
11 changed files with 136 additions and 95 deletions

View File

@@ -24,7 +24,9 @@ import socket
import functools
from typing import Dict
from typing import Callable
from typing import Optional
from typing import Any
from ...logging import get_logger
@@ -66,11 +68,15 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
"mac": Option("", type=valid_mac, if_empty=""),
}
async def read(self, pin: int) -> bool:
@classmethod
def get_pin_validator(cls) -> Callable[[Any], str]:
return str
async def read(self, pin: str) -> bool:
_ = pin
return False
async def write(self, pin: int, state: bool) -> None:
async def write(self, pin: str, state: bool) -> None:
_ = pin
if not state:
return