Ich habe das Python-Script vom Anfang 1:1 übernommen, bekomme aber eine "invalid syntax" Meldung über doorpi_cli --trace:
2016-05-01 12:09:57,364 [TRACE] [doorpi.action.handler] fire Event OnKeyUp from doorpi.keyboard.from_gpio asyncron
2016-05-01 12:09:57,368 [TRACE] [doorpi.action.handler] fire Event OnKeyUp_22 from doorpi.keyboard.from_gpio asyncron
2016-05-01 12:09:57,369 [DEBUG] [doorpi.action.handler] no actions for event OnKeyUp - skip fire_event OnKeyUp from doorpi.keyboard.from_gpio
2016-05-01 12:09:57,373 [TRACE] [doorpi.action.handler] fire Event OnKeyUp_onboardpins.22 from doorpi.keyboard.from_gpio asyncron
2016-05-01 12:09:57,374 [DEBUG] [doorpi.action.handler] no actions for event OnKeyUp_22 - skip fire_event OnKeyUp_22 from doorpi.keyboard.from_gpio
2016-05-01 12:09:57,378 [DEBUG] [doorpi.action.handler] [JTBF3V] fire for event OnKeyUp_onboardpins.22 this actions [<doorpi.action.SingleActions.os_execute.OsExecuteA ction instance at 0x7469fe40>]
2016-05-01 12:09:57,379 [TRACE] [doorpi.action.handler] [JTBF3V] try to fire action OsExecuteAction with args () and kwargs {'command': '/usr/local/etc/DoorPi/scripts/LoxoneNotify.py'}
2016-05-01 12:09:57,380 [TRACE] [doorpi.action.base] run OsExecuteAction with args () and kwargs {'command': '/usr/local/etc/DoorPi/scripts/LoxoneNotify.py'}
File "/usr/local/etc/DoorPi/scripts/LoxoneNotify.py", line 3
import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
^
SyntaxError: invalid syntax
2016-05-01 12:09:57,509 [TRACE] [doorpi.action.handler] [JTBF3V] finished fire_event for event_name OnKeyUp_onboardpins.22
Das Script sieht genau so aus:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto("? #50 ?", ("192.168.1.10", 7111))
Kann ehrlich gesagt keinen Fehler im Script erkennen
Gruß
Jörg
Kommentar