Skip to content

Commit

Permalink
try to handle group state update
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Jan 17, 2024
1 parent 4842778 commit 8beb077
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/class/z2m.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,17 @@ public static function handleMqttMessage($_datas) {
if(!is_object($eqLogic)){
$eqLogic = eqLogic::byLogicalId('group_' . $key, 'z2m');
}
if(!is_object($eqLogic)){
foreach (self::byType('z2m') as $findEqLogic) {
if($findEqLogic->getConfiguration('isgroup',0) == 0){
continue;
}
if($findEqLogic->getConfiguration('friendly_name','') == $key){
$eqLogic = $findEqLogic;
break;
}
}
}
if (is_object($eqLogic)) {
if(isset($values['last_seen']) && $eqLogic->getConfiguration('maxLastSeen',0) > 0 && (strtotime($values['last_seen'])+$eqLogic->getConfiguration('maxLastSeen',0)) < strtotime('now')){
continue;
Expand Down

0 comments on commit 8beb077

Please sign in to comment.