Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Jan 22, 2024
1 parent 6bca5c0 commit 22b9cc7
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions core/class/netatmo_energy.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ public static function sync(){
continue;
}
$device = self::getRoomDevice($home['modules'],$room['module_ids']);
if(!in_array($device,array('NRV','NATherm1'))){
continue;
}
$eqLogic = eqLogic::byLogicalId($room['id'], 'netatmo');
if (!is_object($eqLogic)) {
$eqLogic = new netatmo();
Expand Down Expand Up @@ -162,12 +159,25 @@ public static function refresh(){
public static function execCmd($_cmd,$_options = array()){
$eqLogic = $_cmd->getEqLogic();
if($_cmd->getLogicalId() == 'setpoint'){
netatmo::request('/setroomthermpoint',array(
'home_id' => $eqLogic->getConfiguration('home_id'),
'room_id' => $eqLogic->getLogicalId(),
'mode' => 'manual',
'temp' => $_options['slider'],
),'POST');
if($eqLogic->getConfiguration('device') == 'OTM'){
netatmo::request('/setstate ',array(
'home' => array(
'id' => $eqLogic->getConfiguration('home_id'),
'rooms' => array(
'id' => $eqLogic->getLogicalId(),
'therm_setpoint_mode' => 'manual',
'therm_setpoint_temperature' => $_options['slider'],
)
)
),'POST');
}else{
netatmo::request('/setroomthermpoint',array(
'home_id' => $eqLogic->getConfiguration('home_id'),
'room_id' => $eqLogic->getLogicalId(),
'mode' => 'manual',
'temp' => $_options['slider'],
),'POST');
}
}else if($_cmd->getLogicalId() == 'mode_auto'){
netatmo::request('/setroomthermpoint',array(
'home_id' => $eqLogic->getConfiguration('home_id'),
Expand Down

0 comments on commit 22b9cc7

Please sign in to comment.