Read the statement by Michael Teeuw here.
Profile switcher and adafruit fingerprint
-
@jmalco
Your python script could send HTTP request directly or by using curl.
There are several modules which can get RESTful HTTP request.
MMM-NotificationTrigger is one of them. It can listen some REQUEST and can translate it into some notification whichever.
Or As far as I know MMM-Remote-Control can listen REQUEST also. -
Gracias por la respuesta, lo probaré y comentaré el resultado.
Thanks for the reply, I’ll try it and comment on the result
-
Buenas tardes:
He estado probando con MMM-remote-control y no hay manera, no sé como hacer que simplemente muestre una alerta desde my módulo python. Os pongo lo que envío:
headers={“Content-Type”:“application/json”}
payload = {
“action” : “SHOW_ALERT”,
“message” : “adios”,
“timer” : 4,
“title” : “hola”,
“type” : “alert”
}
r = requests.get(“http://localhost:8080”,data=json.dumps(payload), headers=headers)
y recobo una respuesta 200 http pero no muestra nada en el espejo.
Tampoco he sabido encontrar cómo llegan o dónde llega la notificacion.
¿Como debo actuar? ¿Que hago mal?Saludos
Good afternoon:
I have been testing with MMM-remote-control and there is no way, I do not know how to make it simply show an alert from my python module. I put what I send:
headers = {“Content-Type”: “application / json”}
payload = {
“action”: “SHOW_ALERT”,
“message”: “goodbye”,
“timer”: 4,
“title”: “hello”,
“type”: “alert”
}
r = requests.get (“http: // localhost: 8080”, data = json.dumps (payload), headers = headers)
and I pick up an answer 200 http but it shows nothing in the mirror.
Neither have I been able to find how they arrive or where the notification arrives.
How should I act? What do I do wrong?regards
-
Buenos días:
De momento he conseguido poder mostrar alertas a traves de curl, reinstalando todo desde cero e instalando primero mmm_api y despues mmm_remote_control, ahora la duda la tengo con la forma de enviar mediante peticiones get o post desde requests en python. ¿Alguna sugerencia o ejemplo?
Gracias por adelantadoGood Morning:
At the moment I have managed to show alerts through curl, reinstalling everything from scratch and installing first mmm_api and then mmm_remote_control, now I have the question with the way to send via get or post requests from requests in python. Any suggestions or examples?
Thanks in advance -
import requests response = requests.get('http://localhost:8080/endpoint') print response.status_code
-
Bueno, volvemos al tema:
Ahora estoy probando con el modulo MMM-Page-Selector, y no tengo nada claro como debo mandar la petición request.
La que mando es:
r = requests.get(“http://192.168.xx.xx:8080/api/modules/MMM-Page-Selector?PAGE_SELECT=xxxxxx”
A lo que se me responde un http 400 (¿bad request?)
¿En que me equivoco?Saludos y gracias por adelantado
Well, we return to the topic:
Now I’m testing with the MMM-Page-Selector module, and I’m not sure how to send the request request.
The one I command is:
r = requests.get (“http: //192.168.xx.xx: 8080 / api / modules / MMM-Page-Selector? PAGE_SELECT = xxxxxx”
To which I answered an http 400 (bad request?)
What is wrong?Greetings and thanks in advance