]> www.average.org Git - loctrkd.git/blobdiff - loctrkd/beesure.py
Update man pages to use correct name
[loctrkd.git] / loctrkd / beesure.py
index dcf16ba227fd7ca585baa9371595e19307917fe9..b3afae149e619875f7ec089a97690de182ba0459 100755 (executable)
@@ -43,6 +43,7 @@ __all__ = (
     "Respond",
 )
 
+PMODNAME = __name__.split(".")[-1]
 PROTO_PREFIX = "BS:"
 
 ### Deframer ###
@@ -679,3 +680,13 @@ def exposed_protos() -> List[Tuple[str, bool]]:
         for cls in CLASSES.values()
         if hasattr(cls, "rectified")
     ]
+
+
+def make_response(cmd: str, imei: str, **kwargs: Any) -> Optional[BeeSurePkt]:
+    if cmd == "poweroff":
+        return POWEROFF.Out()
+    elif cmd == "refresh":
+        return MONITOR.Out()
+    elif cmd == "message":
+        return MESSAGE.Out(message=kwargs.get("txt", "Hello"))
+    return None