Skip to content

Commit

Permalink
* (Apollon77) Optimize discovery and device connection checks
Browse files Browse the repository at this point in the history
* (Apollon77) IPs of unconnected devices can be set via the ip state now
* (Apollon77) Fix crash cases reported by Sentry
  • Loading branch information
Apollon77 committed Nov 16, 2022
1 parent b276bf7 commit c59b62d
Show file tree
Hide file tree
Showing 4 changed files with 450 additions and 268 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ With this featureset you can choose between all available options and work with
The "former" App-Proxy-Sync is still available in the Adapter Config but not recommended anymore. It is much easier to do the new One Time Cloud Sync.

### If UDP discovery do not work
If the devices are not correctly detected via their UDP packages you can set the IP manually by editing the device object. see https://github.com/Apollon77/ioBroker.tuya/issues/221#issuecomment-702392636
If the devices are not correctly detected via their UDP packages you can set the IP manually by setting the ip state of the device to the correct IP.
The former alternative is to edit the device object. See https://github.com/Apollon77/ioBroker.tuya/issues/221#issuecomment-702392636

### Note for Battery powered devices
As already told above Battery powered devices are not supported by this adapter when using only local connections! The reason is that they are not online all the time to save power. Whenever they get a signal, they go online, send the update to the the Tuya cloud servers and go offline again. They do not emit any UDP packages or are online long enough so that the adapter could connect to them.
Expand Down Expand Up @@ -122,6 +123,12 @@ When there are issues with the Tuya App Cloud synchronisation then additional lo
Send the log with reference to the generated GitHub issue to [email protected]

## Changelog

### __WORK IN PROGRESS__
* (Apollon77) Optimize discovery and device connection checks
* (Apollon77) IPs of unconnected devices can be set via the ip state now
* (Apollon77) Fix crash cases reported by Sentry

### 3.9.1 (2022-11-14)
* (Apollon77) Add support for local control of Tuya protocols 3.2 and 3.4
* (TA2k/Apollon77) Add basic support for IR devices (Gateway and Sub Devices)
Expand Down
4 changes: 3 additions & 1 deletion lib/mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'use strict';
const fs = require('fs');
const path = require('path');
const util = require('util');

let knownSchemas = {};
try {
Expand All @@ -17,7 +18,7 @@ try {
function addSchema(productKey, schema) {
if (!productKey || !schema) return false;
if (knownSchemas[productKey]) {
if (JSON.stringify(knownSchemas[productKey].schema) === JSON.stringify(schema.schema) && JSON.stringify(knownSchemas[productKey].schemaExt) === JSON.stringify(schema.schemaExt)) {
if (util.isDeepStrictEqual(knownSchemas[productKey].schema, schema.schema) && util.isDeepStrictEqual(knownSchemas[productKey].schemaExt, schema.schemaExt)) {
return false;
}
}
Expand Down Expand Up @@ -210,6 +211,7 @@ function getObjectsForData(data, allowWrite) {
if (role !== '') common.role = role;
if (!common.role) common.role = 'state';

common.native = {};
objs.push(common);
}
return objs;
Expand Down
Loading

0 comments on commit c59b62d

Please sign in to comment.