diff --git a/73_NUKIBridge.pm b/73_NUKIBridge.pm index 7985502..ceb1062 100644 --- a/73_NUKIBridge.pm +++ b/73_NUKIBridge.pm @@ -571,95 +571,8 @@ sub NUKIBridge_CallBlocking($$) { Log3 $name, 3, "$name: invalid json detected for $url: $data"; return undef; } - - $data = '[ -{"timestamp": "2016-10-23T08:21:56+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:21:53+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:21:53+00:00", "type": "BLE-Disconnected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:21:52+00:00", "type": "BLE-ReceivingMsg", "nukiId": "ABCDEF", "cmdId": "000C"}, -{"timestamp": "2016-10-23T08:21:51+00:00", "type": "BLE-SendingMsg", "nukiId": "ABCDEF", "cmdId": "0001"}, -{"timestamp": "2016-10-23T08:21:51+00:00", "type": "BLE-Connect", "handles": [24, 28]}, -{"timestamp": "2016-10-23T08:21:51+00:00", "type": "BLE-Connected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:21:49+00:00", "type": "BLE-Connect", "macAddr": "123456"}, -{"timestamp": "2016-10-23T08:21:49+00:00", "type": "BLE-Connect", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:21:49+00:00", "type": "HTTP-LockState", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:21:49+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:21:38+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:21:16+00:00", "type": "HTTP-List"}, -{"timestamp": "2016-10-23T08:21:16+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:20:59+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:20:59+00:00", "type": "BLE-Disconnected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:20:58+00:00", "type": "BLE-ReceivingMsg", "nukiId": "ABCDEF", "cmdId": "000C"}, -{"timestamp": "2016-10-23T08:20:57+00:00", "type": "BLE-SendingMsg", "nukiId": "ABCDEF", "cmdId": "0001"}, -{"timestamp": "2016-10-23T08:20:57+00:00", "type": "BLE-Connect", "handles": [24, 28]}, -{"timestamp": "2016-10-23T08:20:57+00:00", "type": "BLE-Connected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:20:56+00:00", "type": "BLE-Connect", "macAddr": "123456"}, -{"timestamp": "2016-10-23T08:20:56+00:00", "type": "BLE-Connect", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:20:56+00:00", "type": "HTTP-LockState", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:20:56+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:20:37+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:20:16+00:00", "type": "HTTP-List"}, -{"timestamp": "2016-10-23T08:20:16+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:19:58+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:19:58+00:00", "type": "BLE-Disconnected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:19:57+00:00", "type": "BLE-ReceivingMsg", "nukiId": "ABCDEF", "cmdId": "000C"}, -{"timestamp": "2016-10-23T08:19:56+00:00", "type": "BLE-SendingMsg", "nukiId": "ABCDEF", "cmdId": "0001"}, -{"timestamp": "2016-10-23T08:19:56+00:00", "type": "BLE-Connect", "handles": [24, 28]}, -{"timestamp": "2016-10-23T08:19:56+00:00", "type": "BLE-Connected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:19:56+00:00", "type": "BLE-Connect", "macAddr": "123456"}, -{"timestamp": "2016-10-23T08:19:56+00:00", "type": "BLE-Connect", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:19:56+00:00", "type": "HTTP-LockState", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:19:56+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:19:39+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:19:39+00:00", "type": "BLE-Disconnected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:19:38+00:00", "type": "BLE-ReceivingMsg", "nukiId": "ABCDEF", "cmdId": "000C"}, -{"timestamp": "2016-10-23T08:19:36+00:00", "type": "BLE-SendingMsg", "nukiId": "ABCDEF", "cmdId": "0001"}, -{"timestamp": "2016-10-23T08:19:36+00:00", "type": "BLE-Connect", "handles": [24, 28]}, -{"timestamp": "2016-10-23T08:19:36+00:00", "type": "BLE-Connected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:19:36+00:00", "type": "BLE-Connect", "macAddr": "123456"}, -{"timestamp": "2016-10-23T08:19:36+00:00", "type": "BLE-Connect", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:19:36+00:00", "type": "HTTP-LockState", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:19:36+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:19:26+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:19:16+00:00", "type": "HTTP-List"}, -{"timestamp": "2016-10-23T08:19:16+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:18:58+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:18:58+00:00", "type": "BLE-Disconnected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:18:57+00:00", "type": "BLE-ReceivingMsg", "nukiId": "ABCDEF", "cmdId": "000C"}, -{"timestamp": "2016-10-23T08:18:56+00:00", "type": "BLE-SendingMsg", "nukiId": "ABCDEF", "cmdId": "0001"}, -{"timestamp": "2016-10-23T08:18:56+00:00", "type": "BLE-Connect", "handles": [24, 28]}, -{"timestamp": "2016-10-23T08:18:56+00:00", "type": "BLE-Connected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:18:56+00:00", "type": "BLE-Connect", "macAddr": "123456"}, -{"timestamp": "2016-10-23T08:18:56+00:00", "type": "BLE-Connect", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:18:56+00:00", "type": "HTTP-LockState", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:18:56+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:18:49+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:18:39+00:00", "type": "BLE-Disconnected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:18:08+00:00", "type": "BLE-Connect", "handles": [24, 28]}, -{"timestamp": "2016-10-23T08:18:08+00:00", "type": "BLE-Connected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:18:08+00:00", "type": "BLE-Connect", "macAddr": "123456"}, -{"timestamp": "2016-10-23T08:18:08+00:00", "type": "BLE-Connect", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:18:08+00:00", "type": "BLE-Disconnected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:57+00:00", "type": "SSE-KeyturnerResponse", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:57+00:00", "type": "BLE-ReceivingSSE", "nukiId": "ABCDEF", "auth": "00000201"}, -{"timestamp": "2016-10-23T08:17:56+00:00", "type": "BLE-SendingSSE", "nukiId": "ABCDEF", "auth": "00000201"}, -{"timestamp": "2016-10-23T08:17:56+00:00", "type": "BLE-Connect", "handles": [24, 28]}, -{"timestamp": "2016-10-23T08:17:56+00:00", "type": "BLE-Connected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:56+00:00", "type": "HTTP-LockState", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:56+00:00", "type": "WLAN-SocketConnected", "connection": 0}, -{"timestamp": "2016-10-23T08:17:56+00:00", "type": "BLE-Connect", "macAddr": "123456"}, -{"timestamp": "2016-10-23T08:17:56+00:00", "type": "BLE-Connect", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:56+00:00", "type": "SSE-KeyturnerRequest", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:41+00:00", "type": "BLE-Disconnected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:36+00:00", "type": "WLAN-SocketDisconnected", "connection": 0}, -{"timestamp": "2016-10-23T08:17:31+00:00", "type": "SSE-KeyturnerResponse", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:31+00:00", "type": "BLE-ReceivingSSE", "nukiId": "ABCDEF", "auth": "00000201"}, -{"timestamp": "2016-10-23T08:17:29+00:00", "type": "BLE-SendingSSE", "nukiId": "ABCDEF", "auth": "00000201"}, -{"timestamp": "2016-10-23T08:17:29+00:00", "type": "BLE-Connect", "handles": [24, 28]}, -{"timestamp": "2016-10-23T08:17:29+00:00", "type": "BLE-Connected", "nukiId": "ABCDEF"}, -{"timestamp": "2016-10-23T08:17:29+00:00", "type": "BLE-Connect", "macAddr": "123456"} -]'; + my $decode_json = decode_json($data); return undef if( !$decode_json );