Skip to content

Commit

Permalink
- **FIX**: Detection of StateText change TasmoAdmin#199, TasmoAdmin#154
Browse files Browse the repository at this point in the history
  • Loading branch information
reloxx13 committed Sep 5, 2018
1 parent 81bdfa8 commit 27c372b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions tasmoadmin/includes/Sonoff.php
Expand Up @@ -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(
Expand All @@ -571,7 +571,7 @@ public function stateTextsDetection( $status ) {

/**
* PL
*/."do, powyżej, powyzej, wysoki, otwarte, "
*/."do, powyżej, powyzej, wysoki, otwarte"
)
);

Expand All @@ -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";
}

Expand All @@ -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";
}

Expand All @@ -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";
}

Expand All @@ -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";
}

Expand Down

0 comments on commit 27c372b

Please sign in to comment.