Skip to content

Commit

Permalink
see issue #203: Warnings "has no existing object, this might lead to …
Browse files Browse the repository at this point in the history
…an error"
  • Loading branch information
rg-engineering committed Jan 19, 2021
1 parent c6410e7 commit aee4b74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/database.js
Expand Up @@ -819,6 +819,9 @@ async function CheckMinTemp(room, target) {
async function CheckManualMode(room, target) {
let changed = false;
let handleActors = false;

parentAdapter.log.debug("CheckManualMode " + room.Name);

if (room.State == "auto") {

//this is a special behavior: Thermostat itself handles window open, but new temperatur from thermostat should not be handled as manual
Expand Down Expand Up @@ -878,6 +881,8 @@ async function CheckManualMode(room, target) {
}
async function CheckStartManualMode(room, target) {

parentAdapter.log.debug("CheckStartManualMode " + room.Name);

if (room.CurrentTarget != target) {
parentAdapter.log.debug("CheckStartManualMode: current target " + room.CurrentTarget + " new " + target);

Expand Down Expand Up @@ -931,6 +936,7 @@ async function CheckStopManualMode(room, target) {


async function CheckTargetFromThermostat(room, target) {
parentAdapter.log.debug("CheckTargetFromThermostat " + room.Name);

if (parseInt(parentAdapter.config.UseChangesFromThermostat) == 2) {
parentAdapter.log.debug(room.Name + " got target from thermostat as override: " + target);
Expand Down Expand Up @@ -1038,7 +1044,7 @@ async function SetNewTarget4Profilpoint(room, target) {

if (id.length > 0) {
parentAdapter.log.debug("SetNewTarget4Profilpoint id " + id + " to " + target);
await parentAdapter.setState(id, { ack: false, val: target });
await parentAdapter.setForeignStateAsync(id, { ack: false, val: target });
}
else {
parentAdapter.log.error("SetNewTarget4Profilpoint id not found " + JSON.stringify(room) + " " + parseInt(parentAdapter.config.ProfileType, 10));
Expand Down
5 changes: 4 additions & 1 deletion main.js
Expand Up @@ -643,7 +643,10 @@ async function HandleStateChange(id, state) {
}

if (handled) {
await adapter.setStateAsync(id, { ack: true });
//adapter.log.debug("### ack for " + id);
// ### ack for heatingcontrol.0.Rooms.Wohnzimmer.StatusLog
// ### ack for javascript.0.Target1
await adapter.setForeignStateAsync(id, { ack: true });
}
}
else {
Expand Down

0 comments on commit aee4b74

Please sign in to comment.