Starting at least last night, using any writeAttribute
Matter method started erroring with an uncatchable exception which completely crashes the script.
This exact kind of code worked at least a week ago (maybe even earlier yesterday), and then last night when I was working on some changes I noticed a new crash that was not happening within my code.
I'm not sure what would have caused this as I don't think my Matter devices had any firmware updates, nor the Flic Hub LR getting a firmware update.
It appears that the attribute is getting set, but something after that point in underlying Flic code is not expecting a Success
value.
EXAMPLE CODE:
const matterModule = require('matter')
const matterDevices = matterModule.getNodes()
const matterDeviceIDsForNames = {}
for (const thisMatterDevice of matterDevices) {
matterDeviceIDsForNames[thisMatterDevice.name] = thisMatterDevice.nodeId
}
const thisMatterDeviceID = matterDeviceIDsForNames['Living Room Corner Lamp']
const brightnessPercentage = 80
const brightnessLevel = Math.round(254 * (brightnessPercentage / 100))
matterModule.writeAttribute(thisMatterDeviceID, 1, 'Level Control', 'OnLevel', brightnessLevel, () => {})
ERROR OUTPUT:
SyntaxError: unexpected token: 'Success'
at <input>:1
at parse (native)
at handlePacket (core.js:3259)
at onPipeData (core.js:3336)