mirror of
https://github.com/beestat/app.git
synced 2025-08-11 09:13:50 -04:00
Further corrected issue where missing outdoor weather breaks sync
See 4b61e50906dccf09a131d3c93222407d00556abe
This commit is contained in:
parent
e5640b8366
commit
7c23a14247
@ -508,7 +508,7 @@ class runtime extends cora\api {
|
||||
$columns['HVACmode'] === null ||
|
||||
$columns['zoneAveTemp'] === null ||
|
||||
$columns['zoneHumidity'] === null ||
|
||||
$columns['outdoorTemp'] < -1000 || // #384
|
||||
($columns['outdoorTemp'] !== null && $columns['outdoorTemp'] < -1000) || // #384
|
||||
$columns['compHeat1'] === null ||
|
||||
$columns['compHeat2'] === null ||
|
||||
$columns['compCool1'] === null ||
|
||||
@ -599,8 +599,13 @@ class runtime extends cora\api {
|
||||
$data['indoor_temperature'] = $columns['zoneAveTemp'] * 10;
|
||||
$data['indoor_humidity'] = round($columns['zoneHumidity']);
|
||||
|
||||
$data['outdoor_temperature'] = $columns['outdoorTemp'] * 10;
|
||||
$data['outdoor_humidity'] = round($columns['outdoorHumidity']);
|
||||
if($columns['outdoorTemp'] !== null) {
|
||||
$data['outdoor_temperature'] = $columns['outdoorTemp'] * 10;
|
||||
}
|
||||
|
||||
if($columns['outdoorHumidity'] !== null) {
|
||||
$data['outdoor_humidity'] = round($columns['outdoorHumidity']);
|
||||
}
|
||||
|
||||
// Event
|
||||
$event_runtime_thermostat_text = $this->api(
|
||||
|
@ -139,7 +139,7 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range, key) {
|
||||
|
||||
// Initialize moving average.
|
||||
var moving = [];
|
||||
var moving_count = 15;
|
||||
var moving_count = 5;
|
||||
|
||||
var offset;
|
||||
for (var i = 0; i < moving_count; i++) {
|
||||
@ -169,7 +169,11 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range, key) {
|
||||
var outdoor_temperature_moving = beestat.temperature(
|
||||
beestat.runtime_thermostat.get_average_(moving, 'outdoor_temperature')
|
||||
);
|
||||
data.series.outdoor_temperature.push(outdoor_temperature_moving);
|
||||
if (runtime_thermostat.outdoor_temperature === null) {
|
||||
data.series.outdoor_temperature.push(null);
|
||||
} else {
|
||||
data.series.outdoor_temperature.push(outdoor_temperature_moving);
|
||||
}
|
||||
data.metadata.series.outdoor_temperature.data[current_m.valueOf()] =
|
||||
beestat.temperature(runtime_thermostat.outdoor_temperature);
|
||||
data.metadata.series.outdoor_temperature.active = true;
|
||||
@ -178,7 +182,11 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range, key) {
|
||||
moving,
|
||||
'outdoor_humidity'
|
||||
);
|
||||
data.series.outdoor_humidity.push(outdoor_humidity_moving);
|
||||
if (runtime_thermostat.outdoor_humidity === null) {
|
||||
data.series.outdoor_humidity.push(null);
|
||||
} else {
|
||||
data.series.outdoor_humidity.push(outdoor_humidity_moving);
|
||||
}
|
||||
data.metadata.series.outdoor_humidity.data[current_m.valueOf()] =
|
||||
runtime_thermostat.outdoor_humidity;
|
||||
data.metadata.series.outdoor_humidity.active = true;
|
||||
@ -527,7 +535,10 @@ beestat.runtime_thermostat.get_average_ = function(runtime_thermostats, series_c
|
||||
var average = 0;
|
||||
var count = 0;
|
||||
for (var i = 0; i < runtime_thermostats.length; i++) {
|
||||
if (runtime_thermostats[i] !== undefined) {
|
||||
if (
|
||||
runtime_thermostats[i] !== undefined &&
|
||||
runtime_thermostats[i][series_code] !== null
|
||||
) {
|
||||
average += runtime_thermostats[i][series_code];
|
||||
count++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user