@saxnpaule look at this commit: https://github.com/michbeck100/pimatic/commit/3e72a76835f9af2ec77222c994e5ffc93b84806e
Should be clear afterwards.
Apart from this refer to breaking changes of coffeescript 2: https://coffeescript.org/
Pimatic & Node 8.0
@saxnpaule look at this commit: https://github.com/michbeck100/pimatic/commit/3e72a76835f9af2ec77222c994e5ffc93b84806e
Should be clear afterwards.
Apart from this refer to breaking changes of coffeescript 2: https://coffeescript.org/
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten
I had a look into this commit. But there is no config to call super() with. This only works in your case because the config is defined in the Device class itself.
Because of that I asked whether your tradfri node_v8 branch is working.
Edit: Ah, it’s another commit. I need to check this.
That works for me. My plugin is working now. These small adjustments could easily be made to all of my plugins.
We need to define how to move forward. Should we define a peer dependency to pimatic 0.10.* or do you think we should do the step and use a major release? @mwittig What do you think?
@michbeck100 Dependent on @mwittig answer, could you change the version in your node_v8 branch?
@saxnpaule that change is already in my local checkout. I would say we use 0.10.x and the plugins must use this version as peer dependency. But I’m not sure if peer dependencies even work anymore with the npm bundled with node 8
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten
There seems to be still an issue in pimatic. It’s not possible to add a rule.
When you type something in the “then” input field an error occurs:
13:53:44.473 [pimatic] Cannot read property 'ignoreCase' of null
@saxnpaule Good catch. This is because of different behavior in CoffeeScript 2 (see here). Should be fixed now. Just pull the latest changes.
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten
Some results of testing pimatic node_v8. I followed the instructions of @michbeck100 and did a clean implementation of pimatic#node_v8. I used the ‘empty’ config.json.
The cron plugin gave the error ‘Can’t reference ‘this’ before calling super in derived class constructors’. So I applied the changes needed to comply with CoffeeScript 2.x and it worked.
When writing a rule I got the error ’Cannot read property ‘ignoreCase’ of null’. I traced it back to the match function in matcher.coffee. This function is not handling a null value for the options parameter. In coffeescript 2.x, a null value is not automatically translated into a default value. I added code to set options the default value when called with ‘null’ value.
The error is gone and I can add rules.
Just saw the the response of @michbeck100 and i can use the new version
@michbeck100 I’m having issues with Attributes can only be added in the constructor
. Do you know how to do this?
class RaspBeeSwitch extends env.devices.PowerSwitch
constructor: (config, lastState) ->
super(config.id, config.name)
@config = config
@deviceID = @config.deviceID
@_presence = lastState?.presence?.value or false
@_online = lastState?.online?.value or false
@_state = lastState?.state?.value or off
@addAttribute 'presence',
description: "online status",
type: t.boolean
@sweebee is this at pimatic runtime or during development? Maybe you have the wrong pimatic peer dependency?
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten
For the impatient of you, it seems that pimatic 0.9.43, which is the current stable release, seems to work with node 8, too. So you can install it with the instructions from https://pimatic.teamemo.com/Guide/Getting-Started.
Just install node 8 instead node 4 from here: https://nodejs.org/download/release/v8.15.0/node-v8.15.0-linux-armv7l.tar.gz
The rest of the installation should be the same.
For the record: My node_v8 branch still has its right to exist as it upgrades to coffeescript 2 which moves pimatic to ES6 compatible code. Would be great if every developer still tests his plugins with these changes, even if this means that parts of the code must be updated.
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten
@sweebee said in Pimatic & Node 8.0:
@michbeck100 I’m having issues with Attributes can only be added in the constructor. Do you know how to do this?
This is an issue with the new Coffeescript version! As the new version is basing Coffeescript on ES6 it is not possible to access members before the object has been fully initialized by calling super(). This was possible, however, with Coffeescript v1. Unfortunately, the pimatic core heavily relies on this (legacy) feature of Coffeescript.
So, with the legacy coffeescript you can do:
class RaspBeeSwitch extends env.devices.PowerSwitch
constructor: (config, lastState) ->
@addAttribute 'presence',
description: "online status",
type: t.boolean
super(config.id, config.name)
In short: Migrating the pimatic core to the new coffeescript version requires a rewrite of certain functions in the pimatic core.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Currently, I’m running node v10.15.3 and everything seems to be working fine except for the https://www.npmjs.com/package/serialport package which is used in a few plugins.
Still looking for a fix. I’m getting a lot of node-pre-gyp ERR!
errors
@tim Thanks for the feedback.
Fixture for Homeduino is about to be released this week. Johnny-Five and MySensors will be the next I’ll look after. Regarding RfLink there is a pending issue to which I have added a comment with further details for the maintainer.
Are there any other plugins using serialport I am not aware of?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig there is pimatic-led-light
and my plugin pimatic-rfxcom
.
Also pimatic-zwave-usb
but for some reason that one is working fine for me. Which is really weird.
@tim Thanks. Regarding pimatic-rfxcom it is on you It should be fine if you update the dependencies to rfxcom@0.2.2, however, I have not checked if the update implies breaking changes at the level of the rfxcom API.
Btw, as far as I can see pimatic-zwave-usb does not use serialport, but openzwave-shared implements a native driver for serial comms
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig said in Pimatic & Node 8.0:
In short: Migrating the pimatic core to the new coffeescript version requires a rewrite of certain functions in the pimatic core.
Would still be great if we could move to a newer version of coffeescript or even to plain ES6. What do you think?
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten
@mwittig Pimatic RFXCoM is updated & works again. Right now pimatic-led-light is the only problem for me, tried updating the packages but it did not start. Since I’m only using it for Hyperion I’ll look into creating a shellswitch
Hi! My RPi4 is arriving next weekend an I want to do a fresh install on Raspbian Buster.
Upgrade from Stretch to Buster everything runs with node 4.6.2.
Can I now install node 8 next weekend or is the status still testing?
Thank you!
@00lex Would be a good chance to test, don’t you think? 😬 Because all configurations are different there won’t be any guarantee that it works for you, but chances are good.
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten
@00lex
You can even go with Node v10.15.3 (LTS). You can read more about here