Open Schluesselmeister opened 6 years ago
A check has to be added in line 758. To be implemented and tested.
Something like:
if (objects[id]) {
// Do the work, because the OH object already exists. (lines 759 - 762)
} else {
adapter.log.warn('Received [' + id + ']. This object doesn't exists.');
}
Wouldn't it be better that new objects which don't exist would trigger a synchronisation?
From experience perspective I would not want to read the log what fails and need to restart the adapter but the adapter should be that intelligent to handle the sync of new objects when I created them in OH
The automatic synchronization hasn't been implemented yet (as far as I know). For sure, the else branch can be used to trigger a restart of the adapter. But the received message would be lost nevertheless. The else branch can be modified to issue a warning message and trigger a restart of the adapter, As soon as the synchronization has been implemented fully, the else branch can trigger the resync.
If a new object is created in OH and the states are send to IOB prior synchronization of objects, then the adapter throws an exception. After restart (and synchronization) the failure is gone.
If OH objects are received, which have not been synchronized before, then they shall be discarded.