If you reduce the led-light plugin to only the dummyLedLight, you can use it with node 10.
The way to do that is editing 2 files. The following steps in commandline mode
- stop pimatic (sudo service pimatic stop)
- goto node_modules dir in your pimatic directory (mostly /home/pi/pimatic-app/node_modules)
- remove the current pimatic-led-light dir in your node_modules dir
- git clone https://github.com/philip1986/pimatic-led-light.git
- cd pimatic-led-light
- edit pimatic-led-light.coffee, replace the whole content with this
module.exports = (env) ->
DummyLedLight = require('./devices/dummy')(env)
class LedLightPlugin extends env.plugins.Plugin
init: (app, @framework, @config) =>
deviceConfigDef = require('./device-config-schema.coffee')
@framework.deviceManager.registerDeviceClass 'DummyLedLight',
configDef: deviceConfigDef.DummyLedLight
createCallback: (config) -> return new DummyLedLight(config)
@framework.on "after init", =>
# Check if the mobile-frontend was loaded and get a instance
mobileFrontend = @framework.pluginManager.getPlugin 'mobile-frontend'
if mobileFrontend?
mobileFrontend.registerAssetFile 'js', 'pimatic-led-light/ui/led-light.coffee'
mobileFrontend.registerAssetFile 'css', 'pimatic-led-light/ui/led-light.css'
mobileFrontend.registerAssetFile 'html', 'pimatic-led-light/ui/led-light.html'
mobileFrontend.registerAssetFile 'js', 'pimatic-led-light/ui/vendor/spectrum.js'
mobileFrontend.registerAssetFile 'css', 'pimatic-led-light/ui/vendor/spectrum.css'
mobileFrontend.registerAssetFile 'js', 'pimatic-led-light/ui/vendor/async.js'
else
env.logger.warn 'your plugin could not find the mobile-frontend. No gui will be available'
return new LedLightPlugin()
Save the file. Now you the only device thats left is the DummyLedLight
- Edit the file package.json
Change the following lines (remove dependencies and change pimatic version)
"dependencies": {
"bluebird": "^3.1.1",
"cassert": "^0.1.2",
"color": "^0.8.0",
"lodash": "^3.10.1",
"event-to-promise": "0.6.0"
},
"peerDependencies": {
"pimatic": "0.9.*"
},
Save the file. The references to unused (causing errors) dependencies are removed.
- run command npm install
- start pimatic again (sudo service pimatic start)
- activate the led-light plugin in pimatic