Skip to content

Commit

Permalink
improve disable device handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Oct 18, 2024
1 parent de122b9 commit ebaefd2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions core/class/netatmo.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static function refreshClassNetatmo($homesdata = null) {
continue;
}
$eqLogic = eqLogic::byLogicalId($home['id'], 'netatmo');
if (!is_object($eqLogic)) {
if (!is_object($eqLogic) || $eqLogic->getIsEnable() == 0) {
continue;
}
if ($home['therm_mode'] != 'schedule') {
Expand Down Expand Up @@ -131,7 +131,7 @@ public static function refreshClassNetatmo($homesdata = null) {
foreach ($homestatus['errors'] as $deviceerror) {
$ModulesError[$deviceerror['id']] = $deviceerror['code'];
$eqLogic = eqLogic::byLogicalId($deviceerror['id'], 'netatmo');
if (!is_object($eqLogic)) {
if (!is_object($eqLogic) || $eqLogic->getIsEnable() == 0) {
continue;
}
$Cmderrorinfo = $eqLogic->getCmd('info', 'error_status');
Expand All @@ -155,7 +155,7 @@ public static function refreshClassNetatmo($homesdata = null) {
}
}
$eqLogic = eqLogic::byLogicalId($module['id'], 'netatmo');
if (!is_object($eqLogic)) {
if (!is_object($eqLogic) || $eqLogic->getIsEnable() == 0) {
continue;
}
foreach ($eqLogic->getCmd('info') as $cmd) {
Expand All @@ -178,7 +178,7 @@ public static function refreshClassNetatmo($homesdata = null) {
if (isset($homestatus['home']) && isset($homestatus['home']['rooms']) && count($homestatus['home']['rooms']) > 0) {
foreach ($homestatus['home']['rooms'] as $room) {
$eqLogic = eqLogic::byLogicalId($room['id'], 'netatmo');
if (!is_object($eqLogic)) {
if (!is_object($eqLogic) || $eqLogic->getIsEnable() == 0) {
continue;
}
foreach ($eqLogic->getCmd('info') as $cmd) {
Expand Down
8 changes: 4 additions & 4 deletions core/class/netatmo_security.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static function createCamera($_security = null) {
foreach ($security['homes'] as $home) {
foreach ($home['cameras'] as $camera) {
$eqLogic = eqLogic::byLogicalId($camera['id'], 'netatmo');
if(!is_object($eqLogic)){
if(!is_object($eqLogic) || $eqLogic->getIsEnable() == 0){
continue;
}
$url_parse = parse_url($eqLogic->getCache('vpnUrl'). '/live/snapshot_720.jpg');
Expand Down Expand Up @@ -197,7 +197,7 @@ public static function refresh($_security = null) {
continue;
}
$home_eqLogic = eqLogic::byLogicalId($home['id'], 'netatmo');
if (!is_object($home_eqLogic)) {
if (!is_object($home_eqLogic) || $home_eqLogic->getIsEnable() == 0) {
continue;
}
foreach ($home['persons'] as $person) {
Expand All @@ -206,7 +206,7 @@ public static function refresh($_security = null) {
}
foreach ($home['cameras'] as $camera) {
$camera_eqLogic = eqLogic::byLogicalId($camera['id'], 'netatmo');
if (!is_object($camera_eqLogic)) {
if (!is_object($camera_eqLogic) || $camera_eqLogic->getIsEnable() == 0) {
continue;
}
if(isset($camera['light_mode_status'])){
Expand All @@ -223,7 +223,7 @@ public static function refresh($_security = null) {
if(isset($camera['modules'])){
foreach ($camera['modules'] as $module) {
$module_eqLogic = eqLogic::byLogicalId($module['id'], 'netatmo');
if (!is_object($module_eqLogic)) {
if (!is_object($module_eqLogic) || $module_eqLogic->getIsEnable() == 0) {
continue;
}
if(isset($module['battery_percent'])){
Expand Down
4 changes: 2 additions & 2 deletions core/class/netatmo_weather.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function refresh($_weather = null) {
if(isset($weather['devices']) && count($weather['devices']) > 0){
foreach ($weather['devices'] as $device) {
$eqLogic = eqLogic::byLogicalId($device["_id"], 'netatmo');
if (!is_object($eqLogic)) {
if (!is_object($eqLogic) || $eqLogic->getIsEnable() == 0) {
continue;
}
$eqLogic->setConfiguration('firmware', $device['firmware']);
Expand All @@ -103,7 +103,7 @@ public static function refresh($_weather = null) {
if(isset($device['modules']) && count($device['modules']) > 0){
foreach ($device['modules'] as $module) {
$eqLogic = eqLogic::byLogicalId($module["_id"], 'netatmo');
if(!is_object($eqLogic)){
if(!is_object($eqLogic) || $eqLogic->getIsEnable() == 0){
continue;
}
$eqLogic->setConfiguration('rf_status', $module['rf_status']);
Expand Down
1 change: 1 addition & 0 deletions docs/fr_FR/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
>Pour rappel s'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte.
- Correction de warnings
- Meilleur gestion des équipements désactivés

# 06/10/2024

Expand Down

0 comments on commit ebaefd2

Please sign in to comment.