unhb-mqtt/matrix_close.py
2020-06-20 21:17:02 +02:00

14 lines
540 B
Python
Executable file

#!/usr/bin/python
from matrix_client.client import MatrixClient
from unhb_mqtt_config import *
# Prepare Matrix Client
matrix_client = MatrixClient(matrix_server)
matrix_client.login_with_password_no_sync(matrix_bot_user, matrix_bot_passwd)
matrix_room = matrix_client.join_room(matrix_roomid)
matrix_room.send_state_event("m.room.avatar", matrix_closed_json)
matrix_room.send_text("Der Space ist jetzt geschlossen.")
# matrix_room.send_state_event("m.room.avatar", matrix_open_json)
# matrix_room.send_text("Der Space ist jetzt offen.")