Giter VIP home page Giter VIP logo

pibot's People

Contributors

sriks avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pibot's Issues

Simplify event scheduling

Change scheduler such that

  1. All events are emitted with name "com.pibot.scheduler.event"
  2. The listener should look into id of passed in userInfo to see if this an event of interest and respond accordingly.
    Example:

[{ "id": "switch.light.on", "cron": "25 7 * * 1-5", "lightid": "bedroom" }]
added to commandcenter/infra/config/example-schedule.json

var events = Infra.events;
events.on("com.pibot.scheduler.event", function (userInfo) {
var eventId = userInfo["id"];
if (eventId === "schedule.workcountdown") {
consle.info("event has occured schedule.workcountdown");
}
});

Automatically identified events

  1. If the event id starts with auto.speak., then the pibot's speaking skill picks it and speaks the associated message

{ "id": "pibot.speak.timetosleep", "speak": "Hey, its bed time. Have a nice cozy sleep. Good night", "cron": "45 20 * * 1-5" },

Implement logger

Define a logger to serve the following purposes

  1. Should be able to read the logs from ssh
  2. Pretty formatted logs

Crash when 'say joke' command

pibot-0 (err): at _processSay (/home/pi/git/server/pibot/commandcenter/commandcenter.js:34:9)
pibot-0 (err): at Object.process (/home/pi/git/server/pibot/commandcenter/commandcenter.js:80:9)
pibot-0 (err): at _processCommand (/home/pi/git/server/pibot/pibot.js:12:8)
pibot-0 (err): at Object. (/home/pi/git/server/pibot/pibot.js:49:9)
pibot-0 (err): at Object. (/home/pi/git/server/pibot/node_modules/botkit/lib/CoreBot.js:765:28)
pibot-0 (err): at Object.Botkit.botkit.trigger (/home/pi/git/server/pibot/node_modules/botkit/lib/CoreBot.js:791:49)
pibot-0 (err): at Object. (/home/pi/git/server/pibot/node_modules/botkit/lib/SlackBot.js:472:34)
pibot-0 (err): at Object.Botkit.botkit.trigger (/home/pi/git/server/pibot/node_modules/botkit/lib/CoreBot.js:791:49)
pibot-0 (err): at /home/pi/git/server/pibot/node_modules/botkit/lib/CoreBot.js:873:32
pibot-0 (err): TypeError: Cannot call method 'randomJoke' of undefined
pibot-0 (err): at process (/home/pi/git/server/pibot/commandcenter/commandcenter.js:85:15)
pibot-0 (err): at _processSay (/home/pi/git/server/pibot/commandcenter/commandcenter.js:34:9)
pibot-0 (err): at Object.process (/home/pi/git/server/pibot/commandcenter/commandcenter.js:80:9)
pibot-0 (err): at _processCommand (/home/pi/git/server/pibot/pibot.js:12:8)
pibot-0 (err): at Object. (/home/pi/git/server/pibot/pibot.js:49:9)
pibot-0 (err): at Object. (/home/pi/git/server/pibot/node_modules/botkit/lib/CoreBot.js:765:28)
pibot-0 (err): at Object.Botkit.botkit.trigger (/home/pi/git/server/pibot/node_modules/botkit/lib/CoreBot.js:791:49)
pibot-0 (err): at Object. (/home/pi/git/server/pibot/node_modules/botkit/lib/SlackBot.js:472:34)
pibot-0 (err): at Object.Botkit.botkit.trigger (/home/pi/git/server/pibot/node_modules/botkit/lib/CoreBot.js:791:49)
pibot-0 (err): at /home/pi/git/server/pibot/node_modules/botkit/lib/CoreBot.js:873:32

Automate deployment

when pushed to master/when triggered by a special script

  1. raspberry should be notified of new update.
  2. create temp folder, pull code
  3. npm install
  4. if success, replace running app folder with temp folder.
  5. re start pibot

Restructure for standalone deployment

1.Load all dependencies from JSON configuration files places in etc/pibot/. This path is admin only access.
pibot.json: general configuration of

  1. pibot tokens,
  2. preferences - speak volume etc

schedule.json: Scheduler stuff
aws.json: AWS stuff

  1. pibot fails safe with message if a configuration is not found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.