Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(mqtthandler): message format mismatch with mdm agent
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Oct 20, 2018
1 parent b8ef039 commit 9b47fdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions inc/mqtthandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ protected function updateOnlineStatus($topic, $message) {
if (!isset($feedback['online'])) {
return;
}
if ($feedback['online'] == 'false') {
if ($feedback['online'] == false) {
$status = '0';
} else if ($feedback['online'] == 'true') {
} else if ($feedback['online'] == true) {
$status = '1';
} else {
// Invalid value
Expand Down
4 changes: 2 additions & 2 deletions tests/suite-integration/PluginFlyvemdmAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ public function testDeviceOnlineChange() {
$this->boolean($agent->isNewItem())
->isFalse(json_encode($_SESSION['MESSAGE_AFTER_REDIRECT'], JSON_PRETTY_PRINT));

$this->deviceOnlineStatus($agent, 'true', 1);
$this->deviceOnlineStatus($agent, true, 1);

$this->deviceOnlineStatus($agent, 'false', 0);
$this->deviceOnlineStatus($agent, false, 0);
}

/**
Expand Down

0 comments on commit 9b47fdc

Please sign in to comment.