Skip to content

Cannot read data #704

@axxa3000

Description

@axxa3000

Running the example with Node;
const TuyAPI = require('tuyapi');

const device = new TuyAPI({
id: 'xxxxxxxxxxxxxxxxxxxx',
key: 'xxxxxxxxxxxxxxxx',
ip: 'xxx.xxx.xxx.xxx',
version: '3.3',
issueRefreshOnConnect: true});
...

receive:

Connected to device!
DATA from device: RZ�L�J�[�D������){�C���v�G7
console.log(Boolean status of default property: ${data.dps['1']}.);
TypeError: Cannot read properties of undefined (reading '1')

With tinytuya in Python:

status: result {'dps': {'1': True, '2': 50, '4': 'low', '5': 'Auto', '6': 59, '7': 19, '14': True, '16': False, '19': 0}}

What can be happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions