Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
* Simple devices: Thermostat target temperature can be set by schedule
* Rooms/locations: admin UI updated (new options added)
* Minor fixes
  • Loading branch information
sergejey committed Feb 5, 2022
1 parent b21689a commit c8d85ea
Show file tree
Hide file tree
Showing 20 changed files with 913 additions and 462 deletions.
2 changes: 2 additions & 0 deletions languages/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,7 @@
'DEVICES_MOTION_IGNORE' => 'Ignore device events when nobody\'s home',
'DEVICES_MOTION_RESET' => 'Reset "nobody home" status w/o setting timer',
'DEVICES_MOTION_TIMEOUT' => 'Activity timeout (sec)',
'DEVICES_TURNOFF_LIGHTS_ON_IDLE' => 'Turn off lights in the room on idle',
'DEVICES_ALIVE_TIMEOUT' => 'Possible inactivity timeout (hours)',
'DEVICES_MAIN_SENSOR' => 'Main sensor for the room',

Expand Down Expand Up @@ -1331,6 +1332,7 @@
'DEVICES_THERMOSTAT_CURRENT_TARGET_TEMP' => 'Current target temperature',
'DEVICES_THERMOSTAT_THRESHOLD' => 'Temperature threshold (0.25 by default)',
'DEVICES_THERMOSTAT_RELAY_STATUS' => 'Relay status',
'DEVICES_THERMOSTAT_SET_TARGET_TEMPERATURE' => 'Set target temperature',
'DEVICES_ALL_BY_TYPE' => 'List all by types',
'DEVICES_ALL_BY_ROOM' => 'List all by rooms',
'DEVICES_LOAD_TIMEOUT' => 'Load status timeout',
Expand Down
2 changes: 2 additions & 0 deletions languages/ru.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,7 @@
'DEVICES_MOTION_IGNORE' => 'Игнорировать события от устройства, когда никого нет дома',
'DEVICES_MOTION_RESET' => 'Сброс статуса "никого нет дома" без таймера установки',
'DEVICES_MOTION_TIMEOUT' => 'Время активности (секунд)',
'DEVICES_TURNOFF_LIGHTS_ON_IDLE' => 'Выключать освещение в комнате по истечение периода активности',
'DEVICES_ALIVE_TIMEOUT' => 'Допустимое время отсутствия данных (часов)',
'DEVICES_MAIN_SENSOR' => 'Основной сенсор помещения',
'DEVICES_NOT_UPDATING' => 'не обновляется',
Expand Down Expand Up @@ -1328,6 +1329,7 @@
'DEVICES_THERMOSTAT_CURRENT_TARGET_TEMP' => 'Целевая температура',
'DEVICES_THERMOSTAT_THRESHOLD' => 'Порог срабатывания термостата (0.25 по-умолчанию)',
'DEVICES_THERMOSTAT_RELAY_STATUS' => 'Статус реле',
'DEVICES_THERMOSTAT_SET_TARGET_TEMPERATURE' => 'Установить желаемую температуру',
'DEVICES_ALL_BY_TYPE' => 'Все по типам',
'DEVICES_ALL_BY_ROOM' => 'Все по комнатам',
'DEVICES_LOAD_TIMEOUT'=>'Таймер изменения статуса нагрузки',
Expand Down
23 changes: 13 additions & 10 deletions modules/control_modules/control_modules.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,21 @@ function run()
//Получим конфиг модуля

include_once(DIR_MODULES . $name . '/' . $name . '.class.php');
$module = $name;
$module = new ${module}();

$module = new $name();

$genConfig = [];
$iter = 0;

foreach($module->getConfig() as $key => $value) {
$genConfig[$iter]['KEY'] = $key;
$genConfig[$iter]['VALUE'] = $value;
$iter++;
}


$config = $this->getConfig();
if (is_array($config)) {
foreach($config as $key => $value) {
$genConfig[$iter]['KEY'] = $key;
$genConfig[$iter]['VALUE'] = $value;
$iter++;
}

}

$out['MODULE_CONFIG'] = $genConfig;

//Выгружаем инфо из коннекта
Expand Down
11 changes: 10 additions & 1 deletion modules/devices/Rooms_onIdle.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<?php

$this->callMethod('updateActivityStatus');
$this->callMethod("updateActivityStatus");

if ($this->getProperty('turnOffLightsOnIdle')) {
$objects = getObjectsByProperty('linkedRoom',$this->object_title);
foreach($objects as $obj) {
if (gg($obj.'.loadType')=='light' && gg($obj.'.status')) {
callMethod($obj.'.turnOff');
}
}
}
Loading

0 comments on commit c8d85ea

Please sign in to comment.