Hello @mwittig and other @developer,
During testing of the pimatic-woox plugin I am getting a strange error when editing and saving the device.
This only occurs after the color attribute was updated during runtime.
E.g: When editing and saving without a runtime change to color, all works fine. After updating color, then editing and saving the device, an error occurs:
Error restoring changed device woox-test-lamp: No type for color of Woox Test Lamp given
This error is generated by Pimatic::device._checkAttribute(attrName)
The type of color is clearly set (see constructor below).
I have tested in every way imaginable, including commenting out any code that would update the color attribute. Also deleted the entire DB.
Any thoughts are appreciated! PM me if needed.
Below the constructor of the device:
class WooxRGBWLight extends env.devices.DimmerActuator
template: 'wooxdimmer-rgb'
constructor: (@config, lastState, plugin, framework) ->
@debug = plugin.config.debug ? false
@base = commons.base @, @config.class
@id = @config.id
@name = @config.name
@addAttribute 'color',
description: "Hex Color",
type: t.string
@addAttribute 'ct',
description: "WW Color",
type: t.number
@actions.setColor =
description: 'set a light color'
params:
colorCode:
type: t.string
@actions.setCT =
description: 'set light CT color'
params:
colorCode:
type: t.number
@_state = lastState?.state?.value or off
@_mode = lastState?.mode?.value or "white"
@_ct = lastState?.ct?.value or 100
@_color = lastState?.color?.value or 'FFFFFF'
@_hue = lastState?.hue?.value or 0
@_saturation = lastState?.saturation?.value or 0
@_brightness = lastState?.brightness?.value or 100
@_dimlevel = lastState?.dimlevel?.value or 0
super()