Permalink
Browse files

Update zigbee2mqtt.class.php

  • Loading branch information...
directman66 committed Jan 12, 2019
1 parent a3913ad commit 743c1e3ccf0d6cb4d9160ad2789c31d1a21628d4
Showing with 5 additions and 1 deletion.
  1. +5 −1 modules/zigbee2mqtt/zigbee2mqtt.class.php
@@ -304,6 +304,9 @@ function processMessage($path, $value) {
$dev_title=explode('/',$path)[1];
echo $path.":".$dev_title."<br>";
//if (strpos($dev_title,"/set/")==0)
if (strpos($path,"set")===false)
{
$rec=SQLSelectOne("SELECT * FROM zigbee2mqtt_devices WHERE IEEEADDR LIKE '%".DBSafe($dev_title)."%'");
if(!$rec['ID']) { /* If path_write foud in db */
@@ -330,7 +333,7 @@ function processMessage($path, $value) {
if(!$rec['ID']){ /* If 'PATH' not found in db */
/* New query to search 'PATH_WRITE' record in db */
$rec=SQLSelectOne("SELECT * FROM zigbee2mqtt WHERE PATH_WRITE LIKE '".DBSafe($path)."'");
$rec=SQLSelectOne("SELECT * FROM zigbee2mqtt WHERE PATH LIKE '".DBSafe($path)."'");
if($rec['ID']) { /* If path_write foud in db */
if($rec['DISP_FLAG']!="0"){ /* check disp_flag */
@@ -378,6 +381,7 @@ function processMessage($path, $value) {
}
}
}

0 comments on commit 743c1e3

Please sign in to comment.