Hi Everyone, could anyone help me out to make the attributes dynamical in the device config? so people can show or hide devices in the class and choose what they want to be showed. Below is a snipped of 2 devices of the total 13 i have. But currently the devices are static in the plugin.
temperature: null
temperature1: null
attributes:
temperature:
description: "Temperature"
type: "number"
unit: '°C'
acronym: 'Control Setpoint'
temperature1:
description: "Temperature1"
type: "number"
unit: '°C'
acronym: 'Remote Override Setpoint'
constructor: (@config, lastState) ->
@id = @config.id
@name = @config.name
@temperature = lastState?.temperature?.value
@temperature1 = lastState?.temperature1?.value
super()
plugin.otgw.on("control_setpoint", (data) =>
if data?
@temperature = Number(data)
@emit 'temperature', @temperature
)
plugin.otgw.on("remote_override_setpoint", (data) =>
if data?
@temperature1 = Number(data)
@emit 'temperature1', @temperature1
)
getTemperature: -> Promise.resolve(@temperature)
getTemperature1: -> Promise.resolve(@temperature1)