core/source/notification_channels/console.py

42 lines
709 B
Python
Raw Normal View History

2022-11-29 23:53:14 +01:00
class implementation_notification_channel_console(interface_notification_channel):
'''
[implementation]
'''
def parameters_schema(self):
return {
"type": "object",
"additionalProperties": False,
"properties": {
},
"required": [
]
}
'''
[implementation]
'''
def normalize_conf_node(self, node):
return dict_merge(
{
},
node
)
2022-11-29 23:53:14 +01:00
'''
[implementation]
'''
2022-11-30 23:14:38 +01:00
def notify(self, parameters, name, data, state, info):
2022-11-29 23:53:14 +01:00
_sys.stdout.write(
string_coin(
2022-11-30 23:14:38 +01:00
"[{{title}}] <{{condition}}> {{info}}\n",
2022-11-29 23:53:14 +01:00
{
"title": data["title"],
"condition": condition_encode(state["condition"]),
2022-11-30 23:14:38 +01:00
"info": ("(no info)" if (info is None) else info),
2022-11-29 23:53:14 +01:00
}
)
)