7 lines
262 B
Python
7 lines
262 B
Python
from .base import IResponder
|
|
|
|
class AlarmResponder(IResponder):
|
|
def respond(self, parsed_data: dict):
|
|
# 示例:如果数据中有"alarm"字段则打印报警
|
|
if parsed_data.get("alarm"):
|
|
print("报警:", parsed_data["alarm"]) |