platypush/platypush/plugins/config.py

39 lines
825 B
Python
Raw Normal View History

2020-11-30 20:57:00 +01:00
import json
2020-11-21 01:12:08 +01:00
from platypush import Config
2020-11-30 20:57:00 +01:00
from platypush.message import Message
2020-11-21 01:12:08 +01:00
from platypush.plugins import Plugin, action
class ConfigPlugin(Plugin):
@action
def get(self) -> dict:
return Config.get()
2020-11-30 20:57:00 +01:00
@action
def get_plugins(self) -> dict:
return Config.get_plugins()
@action
def get_backends(self) -> dict:
return Config.get_backends()
@action
def get_procedures(self) -> dict:
return json.loads(json.dumps(Config.get_procedures(), cls=Message.Encoder))
2020-11-21 01:12:08 +01:00
@action
def dashboards(self) -> dict:
return Config.get_dashboards()
@action
def get_dashboard(self, name: str) -> str:
return Config.get_dashboard(name)
2020-11-30 20:57:00 +01:00
@action
def get_device_id(self) -> str:
return Config.get('device_id')
2020-11-21 01:12:08 +01:00
# vim:sw=4:ts=4:et: