Skip to content

Commit

Permalink
fixing #66
Browse files Browse the repository at this point in the history
  • Loading branch information
baerengraben authored and baerengraben committed Jan 7, 2022
1 parent 808cd85 commit 5e4f053
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,34 +813,49 @@ function setCurrentHour(self){
'swiss-weather-api.0.forecast.60minutes.day0.actual_hour and write it to swiss-weather-api.0.forecast.current_hour');

self.getState(path + '.' + hour + '00.cur_color.background_color', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.cur_color.background_color' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_background_color = state.val;
} else {
self.log.info(path + '.' + hour + '00.cur_color.background_color' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.cur_color.temperature', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.cur_color.temperature' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_temperature = state.val;
} else {
self.log.info(path + '.' + hour + '00.cur_color.temperature' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.cur_color.text_color', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.cur_color.text_color' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_text_color = state.val;
} else {
self.log.info(path + '.' + hour + '00.cur_color.text_color' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.DD_DEG', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.DD_DEG' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_DD_DEG = state.val;
} else {
self.log.info(path + '.' + hour + '00.DD_DEG' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.FF_KMH', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.FF_KMH' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_FF_KMH = state.val;
} else {
Expand Down Expand Up @@ -888,62 +903,86 @@ function setCurrentHour(self){
}
});
self.getState(path + '.' + hour + '00.PROBPCP_PERCENT', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.PROBPCP_PERCENT' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_PROBPCP_PERCENT = state.val;
} else {
self.log.info(path + '.' + hour + '00.PROBPCP_PERCENT' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.RRR_MM', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.RRR_MM' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_RRR_MM = state.val;
} else {
self.log.info(path + '.' + hour + '00.RRR_MM' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.SYMBOL_CODE', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.SYMBOL_CODE' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_SYMBOL_CODE = state.val;
} else {
self.log.info(path + '.' + hour + '00.SYMBOL_CODE' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.TTH_C', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.TTH_C' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_TTH_C = state.val;
} else {
self.log.info(path + '.' + hour + '00.TTH_C' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.TTL_C', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.TTL_C' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_TTL_C = state.val;
} else {
self.log.info(path + '.' + hour + '00.TTL_C' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.TTT_C', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.TTT_C' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_TTT_C = state.val;
} else {
self.log.info(path + '.' + hour + '00.TTT_C' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.local_date_time', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.local_date_time' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_local_date_time = state.val;
} else {
self.log.info(path + '.' + hour + '00.local_date_time' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
self.getState(path + '.' + hour + '00.type', function (err, state) {
if (err){
self.log.error(path + '.' + hour + '00.type' + ':' + 'This should not happen. Error is ' + err.message);
}
if ((typeof state !== "undefined") && (state !== null)) {
currentHourVariables.local_type = state.val;
} else {
self.log.info(path + '.' + hour + '00.type' + ':' + 'This should not happen. State is undefined or null. So in this run no data is copied for this value');
}
});
next()
next();
}(function() {
resolve(currentHourVariables);
}))
Expand Down

0 comments on commit 5e4f053

Please sign in to comment.