@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.