From 27c372bed351e55af9840579d1461c370d83fce0 Mon Sep 17 00:00:00 2001 From: reloxx13 Date: Thu, 6 Sep 2018 01:57:45 +0200 Subject: [PATCH] - **FIX**: Detection of StateText change #199, #154 --- CHANGELOG.md | 5 ++++- tasmoadmin/includes/Sonoff.php | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c6035a0..a10bf04c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,13 @@ ## Upcoming + +### v1.6.0-beta7 +- **FIX**: Detection of StateText change [#199](https://github.com/reloxx13/TasmoAdmin/issues/199), [#154](https://github.com/reloxx13/TasmoAdmin/issues/154) ### v1.6.0-beta6 - FIX: XAMPP Folder Structure in ZIP -- DEV: Lower zip splitted parts filezize for git +- DEV: Lower zip splitted parts filesize for git ### v1.6.0-beta5 - **FIX**: avoid sending backlog commands twice cuz backlog does not give any response. [#210](https://github.com/reloxx13/TasmoAdmin/issues/210) diff --git a/tasmoadmin/includes/Sonoff.php b/tasmoadmin/includes/Sonoff.php index 45776edf..bdd5395c 100644 --- a/tasmoadmin/includes/Sonoff.php +++ b/tasmoadmin/includes/Sonoff.php @@ -552,7 +552,7 @@ public function stateTextsDetection( $status ) { /** * PL - */."z, poniżej, ponizej, blisko, do, zamknięte, zamkniete, " + */."z, poniżej, ponizej, blisko, do, zamknięte, zamkniete" ) ); $onArray = explode( @@ -571,7 +571,7 @@ public function stateTextsDetection( $status ) { /** * PL - */."do, powyżej, powyzej, wysoki, otwarte, " + */."do, powyżej, powyzej, wysoki, otwarte" ) ); @@ -584,7 +584,7 @@ public function stateTextsDetection( $status ) { //try to detect OFF if( in_array( strtolower( $state ), $offArray ) ) { $state = "OFF"; - } elseif( in_array( $state, $onArray ) ) { + } elseif( in_array( strtolower( $state ), $onArray ) ) { $state = "ON"; } @@ -599,7 +599,7 @@ public function stateTextsDetection( $status ) { //try to detect OFF if( in_array( strtolower( $state ), $offArray ) ) { $state = "OFF"; - } elseif( in_array( $state, $onArray ) ) { + } elseif( in_array( strtolower( $state ), $onArray ) ) { $state = "ON"; } @@ -618,9 +618,9 @@ public function stateTextsDetection( $status ) { $state = $status->StatusSTS->$power; //try to detect OFF - if( in_array( $state, $offArray ) ) { + if( in_array( strtolower( $state ), $offArray ) ) { $state = "OFF"; - } elseif( in_array( $state, $onArray ) ) { + } elseif( in_array( strtolower( $state ), $onArray ) ) { $state = "ON"; } @@ -640,9 +640,9 @@ public function stateTextsDetection( $status ) { $state = $status->$power; //try to detect OFF - if( in_array( $state, $offArray ) ) { + if( in_array( strtolower( $state ), $offArray ) ) { $state = "OFF"; - } elseif( in_array( $state, $onArray ) ) { + } elseif( in_array( strtolower( $state ), $onArray ) ) { $state = "ON"; }