zigbee2mqtt-frontend
zigbee2mqtt-frontend copied to clipboard
Exposes of custom device is reading 'length' of undefined
What happened?
I've modified my converter for a custom button device I am making to have the following fields:
exposes: [e.battery(), e.action()],
with the thought of having the action (on or off) of the button exposed to use elsewhere.
Here's the rest of the converter if it helps: converter.txt
After modifying this and restarting, I go to the "Exposes" tab of one of the devices and get hit with the congrats you've found a bug screen. Not sure if this is my fault of Z2Ms fault...
What browsers are you seeing the problem on?
Chrome
Relevant stacktrace
**Current url**: http://192.168.16.229:8080/#/device/0x6c5cb1fffe586072/exposes
**Previous url**: http://192.168.16.229:8080/#/
**Error type**: TypeError
**Error message**: Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
at net (http://192.168.16.229:8080/assets/index-adb29eee.js:85:213943)
at y2 (http://192.168.16.229:8080/assets/index-adb29eee.js:41:19551)
at u9 (http://192.168.16.229:8080/assets/index-adb29eee.js:43:44101)
at o9 (http://192.168.16.229:8080/assets/index-adb29eee.js:43:39819)
at m3e (http://192.168.16.229:8080/assets/index-adb29eee.js:43:39745)
at Yy (http://192.168.16.229:8080/assets/index-adb29eee.js:43:39596)
at hC (http://192.168.16.229:8080/assets/index-adb29eee.js:43:35959)
at sF (http://192.168.16.229:8080/assets/index-adb29eee.js:43:36764)
at Xs (http://192.168.16.229:8080/assets/index-adb29eee.js:41:3288)
at http://192.168.16.229:8080/assets/index-adb29eee.js:43:34286
Did you download state.json.zip?
I will attach state.json.zip
I have made a pull request fixing this bug here. Close this issue when merged :)
Changing from e.action() to e.enum('action', ea.STATE, ['on', 'off']) in the converter avoids this issue (if anyone is struggling as well before the fix is merged).