fix plugin state

This commit is contained in:
jxxghp
2023-08-03 17:58:00 +08:00
parent 51016d636b
commit 79a57b0576
12 changed files with 51 additions and 11 deletions

View File

@ -27,18 +27,21 @@ class DirMonitor(_PluginBase):
# 私有属性
_monitor = None
_enable = False
_enabled = False
def init_plugin(self, config: dict = None):
# 读取配置
if config:
self._enable = config.get("enable")
self._enabled = config.get("enabled")
# 停止现有任务
self.stop_service()
# TODO 启动任务
def get_state(self) -> bool:
return self._enabled
@staticmethod
def get_command() -> List[Dict[str, Any]]:
pass