<commit_before>-- Use trigger event "Motion detected" of single Device (camera) in the IPCorder Action Editor

devices[event.device].AddNote{note="Motion Detected"};

interval = 15 -- MD record interval in seconds

initialMD = os.time();

if devices[event.device].manualRecording == false then
  devices[event.device].AddNote{note="Manual recording started"};
  devices[event.device].ManualRecordingStart(); -- start of manual recording
end;

function checkMD()
  if ((os.time() - initialMD) < interval) then -- check if new MDs are comming
    -- devices[event.device].AddNote{note="MDs are still comming"};
  else
    devices[event.device].AddNote{note="Manual recording stopped"};
    devices[event.device].ManualRecordingStop(); -- end of manual recoring
  end;
end;

delay(interval, function() checkMD(); end);<commit_msg>Start manual recording on motion detection event<commit_after>-- Use trigger event "Motion detected" of single Device (camera) in the IPCorder Action Editor

devices[event.device].AddNote{note="Motion Detected"};

interval = 15 -- MD record interval in seconds

initialMD = os.time();

if devices[event.device].manualRecording == false then
  devices[event.device].AddNote{note="Manual recording started"};
  devices[event.device].ManualRecordingStart(); -- start of manual recording
end;

function checkMD()
  if ((os.time() - initialMD) < interval) then -- check if new MDs are comming
    devices[event.device].AddNote{note="MDs are still comming"};
  else
    devices[event.device].AddNote{note="Manual recording stopped"};
    devices[event.device].ManualRecordingStop(); -- end of manual recoring
  end;
end;

delay(interval, function() checkMD(); end);
{'fraction_non_alphanumeric': 0.1269276393831554, 'fraction_numerical': 0.002372479240806643, 'mean_word_length': 5.068345323741007, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7456389', 'n_tokens_mistral': 492, 'n_tokens_neox': 473, 'n_words': 147}