Skip to content

Commit

Permalink
see issue #337: bug fix in calculate profil position
Browse files Browse the repository at this point in the history
  • Loading branch information
rg-engineering committed Dec 4, 2022
1 parent f9916e9 commit 76aa414
Show file tree
Hide file tree
Showing 5 changed files with 3,266 additions and 1,599 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ When the adapter crashes or an other Code error happens, this error message that

## Changelog

### 2.9.3 (in progress)
* (René) update dependencies
* (René) see issue #337: bug fix in calculate profil position

### 2.9.3 (2022-10-28)
* (René) update dependencies
* (René) see issue #323: add telegram user to select box
Expand Down
15 changes: 14 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"common": {
"name": "heatingcontrol",
"version": "2.9.3",
"version": "2.10.0",
"news": {
"2.10.0": {
"en": "bug fix: calculate profil points",
"de": "Bugfix: Profilpunkte berechnen",
"ru": "исправление ошибки: подсчет очков профиля",
"pt": "correção de bug: calcular pontos de perfil",
"nl": "bugfix: bereken profielpunten",
"fr": "correction de bug : calcul des points de profil",
"it": "bug fix: calcola i punti del profilo",
"es": "corrección de errores: calcular puntos de perfil",
"pl": "poprawka błędu: oblicz punkty profilu",
"uk": "виправлення помилки: розрахунок балів профілю",
"zh-cn": "错误修复:计算个人资料点"
},
"2.9.3": {
"en": "add telegram user to select box",
"de": "Telegrammbenutzer zum Auswahlfeld hinzufügen",
Expand Down
16 changes: 11 additions & 5 deletions lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,12 @@ async function CheckTargetFromThermostat(room, target) {
parentAdapter.log.debug(room.Name + " got target from thermostat as new profil point: " + target);

await SetNewTarget4Profilpoint(room, target);

//see issue #337: set new profile value to all thermostats
const currentProfile = await GetCurrentProfile();
//aktuellen Profilpunkt setzen
await GetCurrentProfilePoint(room, currentProfile);

}
else if (parseInt(parentAdapter.config.UseChangesFromThermostat) == 5) {
parentAdapter.log.debug(room.Name + " got target from thermostat until next profil point: " + target);
Expand All @@ -1195,7 +1201,7 @@ async function CheckTargetFromThermostat(room, target) {
//*******************************************************************
//
async function SetNewTarget4Profilpoint(room, target) {
parentAdapter.log.debug("start SetNewTarget4Profilpoint " + room.CurrentTimePeriod + " " + parentAdapter.config.ProfileType);
parentAdapter.log.debug("start SetNewTarget4Profilpoint " + room.CurrentTimePeriod + " / " + room.ActiveTimeSlot + " " + parentAdapter.config.ProfileType);

try {
let id = "";
Expand All @@ -1208,7 +1214,7 @@ async function SetNewTarget4Profilpoint(room, target) {
if (parseInt(parentAdapter.config.ProfileType, 10) === 1) {
//Profiles.1.Küche.Mo-Su.Periods.1.Temperature
profilePart = "Mo-Su";
id = "Profiles." + currentProfile + "." + room.Name + "." + profilePart + ".Periods." + room.CurrentTimePeriod + ".Temperature";
id = "Profiles." + currentProfile + "." + room.Name + "." + profilePart + ".Periods." + room.ActiveTimeSlot + ".Temperature";
}
else if (parseInt(parentAdapter.config.ProfileType, 10) === 2) {
//Profiles.1.Wohnzimmer.Mo-Fr.Periods.1.Temperature
Expand All @@ -1225,12 +1231,12 @@ async function SetNewTarget4Profilpoint(room, target) {
if (profilePart == "Mo-Fr" && room.PublicHolidyToday && parentAdapter.config.PublicHolidayLikeSunday === true) {
profilePart = "Sa-Su";
parentAdapter.log.debug("week end profile used for public holiday");
}
}
else if (profilePart == "Mo-Fr" && room.HolidayPresent && parentAdapter.config.HolidayPresentLikeSunday === true) {
profilePart = "Sa-Su";
parentAdapter.log.debug("week end profile used for holiday at home");
}
id = "Profiles." + currentProfile + "." + room.Name + "." + profilePart + ".Periods." + room.CurrentTimePeriod + ".Temperature";
id = "Profiles." + currentProfile + "." + room.Name + "." + profilePart + ".Periods." + room.ActiveTimeSlot + ".Temperature";

}
else if (parseInt(parentAdapter.config.ProfileType, 10) === 3) {
Expand Down Expand Up @@ -1269,7 +1275,7 @@ async function SetNewTarget4Profilpoint(room, target) {
profilePart = "Sun";
parentAdapter.log.debug("sunday profile used for holiday at home");
}
id = "Profiles." + currentProfile + "." + room.Name + "." + profilePart + ".Periods." + room.CurrentTimePeriod + ".Temperature";
id = "Profiles." + currentProfile + "." + room.Name + "." + profilePart + ".Periods." + room.ActiveTimeSlot + ".Temperature";
}

if (id.length > 0) {
Expand Down
Loading

0 comments on commit 76aa414

Please sign in to comment.