Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
cherry-core
Advanced tools
# Cherry
An extensible hub for home automation/Internet of Things.
## Overview
Cherry acts as a hub for your house and allows any connected component to communicate with each other. Cherry's power comes from its plugin system. Connected devices talk to each other through the firehose, a message bus provided by Cherry. Adding a new component to the system is as simple as writing a few lines of code (Node.js module or ClojureScript namespace).
As an example, a Philips Hue plugin could wait for "to:lights" messages on the firehose and flip the lights in response. A GPIO plugin could send "from:pin" messages when a button is pressed on the Raspberry Pi. Finally, another plugin could read "from:pin" messages and turns them into "to:lights" messages. Boum, lights turn on and off when a button is pressed. This is easily expressed in code:
module.exports = function (ec) {
console.log("lightswitch ready to rock");
ec.consume(function (msg) {
console.log("lightswitch received", require('util').inspect(msg));
switch (msg.from) {
case "pin":
if (msg.body === "low") {
ec.produce({to: "lights", body: {on: true}});
} else if (msg.body === "high") {
ec.produce({to: "lights", body: {on: false}});
}
break;
};
});
}
## Using
lein do cljsbuild clean, cljsbuild once
cp config.json.sample config.json
node dist/cherry.js
## Building
lein do cljsbuild clean, cljsbuild once
node dist/cherry.js
## Creating a plugin
We've focused on making it really simple and easy to write a plugin for Cherry.
cf. examples
directory
You can configure plugins through a config.json
file.
Consumes: "to:music" Produces: "from:music" with music info
"mopidy_url": "ws://192.168.1.66:6680/mopidy/ws"
Consumes: "to:lights"
"hue_host": "http://192.168.1.169"
Produces: "from:chat"
"hipchat_jid": "88888_8888888@chat.hipchat.com",
"hipchat_pwd": "mypassword",
"hipchat_room": "88888_yay@conf.hipchat.com/My Username",
Produces: "from:semantic"
"witd_url": "http://192.168.1.68:8080",
"wit_token": "MY_TOKEN",
Note: requires sudo
to access pins on Raspberry Pi.
Produces: "from:pin"
"gpio_pins": {
"22": ["in", "both"]
},
FAQs
Home automation nerve center
The npm package cherry-core receives a total of 0 weekly downloads. As such, cherry-core popularity was classified as not popular.
We found that cherry-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.