Skip to content

Commit

Permalink
WIP: Implement SMS standard
Browse files Browse the repository at this point in the history
  • Loading branch information
acmacunlay committed Oct 8, 2024
1 parent 3fa676d commit 6799954
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
25 changes: 24 additions & 1 deletion src/pywaveshare/boards/sim868/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@
import typing


class SupportedProtocol(abc.ABC):
class SupportedStandard(abc.ABC):
NAME: typing.Optional[str] = None

RESPONSE_PATTERN = r""


class SMS(SupportedStandard):
NAME = "SMS"

RESPONSE_PATTERN = (
r"loremipsumdolorsitamet"
r"loremipsumdolorsitamet"
r"loremipsumdolorsitamet"
r"loremipsumdolorsitamet"
r"loremipsumdolorsitamet"
r"loremipsumdolorsitamet"
r"loremipsumdolorsitamet"
)


class SupportedProtocolFactory:
pass


if __name__ == "__main__":
protocol = SMS()
print(protocol.RESPONSE_PATTERN)
9 changes: 9 additions & 0 deletions src/pywaveshare/boards/sim868/typedefs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import typing

SMSSend = typing.TypedDict(
"SMSSend",
{
"Recipients": typing.List[str],
"Message": str,
},
)
3 changes: 2 additions & 1 deletion src/pywaveshare/boards/sim868/worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import threading

from . import config, itc
from . import config, itc, protocols


class Worker(threading.Thread):
Expand All @@ -10,6 +10,7 @@ def __init__(self, config: config.Config) -> None:
super().__init__()

self.config = config
self.protocols = protocols.SupportedProtocolFactory()

def run(self) -> None:
itc.IS_WORKER_RUNNING.set()
Expand Down

0 comments on commit 6799954

Please sign in to comment.