Notification handler for Pi-Eye
- NodeJS
- TypeScript
- nodemailer
- Node and npm
- Install NPM package: notification-handler
npm install https://github.com/Pi-Eye/notification-handler
import{Notifications}from"notification-handler";constnotification_config={from_email: "test@email.com";
mail_host: "email.com";
mail_port: 587;
mail_user: "user";
mail_pass: "pass";
emails: "recipient@email.com";// comma separated list of recipiants}constmotion_config={start_trigger: 0.5;// percentage of frames with motion in the past {start_trigger_length} frames to trigger motion
start_trigger_length: 10;
stop_timeout: 100;// frames to wait after no motion detected before emiting stop}notif=newNotifications("Camera Name",motion_config,notification_config);constframe;// some jpg bufferconsttimestamp=Date.now();constmotion=false;notif.Frame(frame,timestamp,motion);Distributed uner the GPL-3.0 License. See LICENSE.txt for more information.
Bennett Wu - bwu1324@gmail.com