Giter VIP home page Giter VIP logo

Comments (3)

msillano avatar msillano commented on July 19, 2024

The tuyapi ver. "6.1.1" introduces two new options:

  • options.nullPayloadOnJSONError = false
  • options.issueGetOnConnect = true

Putting both to false is a partial solution to commands (like 'GET' and 'schema') not handled by some devices and occasionally reported by the device using the misunderstandly "json obj data invalid".

The only open issue is the 'ERROR' level in case of connection loss: using retry this event is not an ERROR requiring programmer intervention, better if it becomes a 'warning' (errors: "Error from socket", "find() timed out. Is the device powered on and the ID or IP correct?").


But I'm using the "node-red-contrib-tuya-smart-device" ver. 1.2.1, which uses tuyapi 5.3.1.
While waiting for an update, my personal solution is to modify "node_modules / tuyapi / index.js" (5.3.1) so:

  1. comment out lines 317-332: the complete block: for (const packet of packets).
  2. comment out line 404: this.get ();
  3. changed line 623 to: throw new Error (` Retry connection: ID $ {this.device.id} `); more informative.

Best regards
m.s.

from node-red-contrib-tuya-smart-device.

vinodsr avatar vinodsr commented on July 19, 2024

Will update the latest version #33

from node-red-contrib-tuya-smart-device.

vinodsr avatar vinodsr commented on July 19, 2024

Updated to latest 6.1.1 with the following options

options.nullPayloadOnJSONError = false
options.issueGetOnConnect = false

Please update to the 2.0.0 version of tuya-smart-device .

Hope this fixes the issues.

from node-red-contrib-tuya-smart-device.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.