I was working on the OTGW plugin adding devices just started with coffee script. I was managed to retreive new data from the OTGW.
But how can i copy the device below so i have 2 temp devices showing in the same class instead of creating another seperate class what i already did and is working.
So i like to see a example with the attributes and temp1 and temp2.
class OTGWMainThermostat extends env.devices.TemperatureSensor _temperature: null constructor: (@config, lastState) -> @id = @config.id @name = @config.name @_temperature = lastState?.temperature?.value super() plugin.otgw.on("temp1", (data) => if data? @_temperature = Number(data) @emit 'temperature', @_temperature ) getTemperature: -> Promise.resolve(@_temperature)