nalajcie / tuya-cloud-to-influxdb

Use Tuya cloud API to push data from devices to influxdb
18 stars 1 forks source link

TypeError: Cannot read properties of undefined (reading 'type') #20

Open yjeanrenaud opened 1 year ago

yjeanrenaud commented 1 year ago
/home/user/tuya-cloud-to-influxdb/lib/common.js:31
    if (def.property.type === 'value') {
                     ^

TypeError: Cannot read properties of undefined (reading 'type')
    at /home/user/tuya-cloud-to-influxdb/lib/common.js:31:22
    at Array.forEach (<anonymous>)
    at Object.getDeviceMeasurement (/home/user/tuya-cloud-to-influxdb/lib/common.js:26:24)
    at /home/user/tuya-cloud-to-influxdb/cli.js:75:34
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.12.1
nalajcie commented 1 year ago

Sorry but I don't have any Tuya devices anymore (I've converted them to Tasmota FW for easier integration with HA).

When You raise an issue, it would be great to write steps to reproduce - from the backtrace I assume You've tried to get the current data from some device. Probably the error relates to some changes in API on Tuya servers.

You can verify it by enabling debug output:

DEBUG=* ./cli.js show

(You will see the raw JSON data being sent/received)