This commit is contained in:
Alex Solomaha
2016-12-11 00:49:56 +02:00
parent 8bd9987d2a
commit 4252193b2e
2 changed files with 59 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ class WebSocketAPI
*/
protected function getWSSUrl()
{
return $this->localWSSUrl . '/?type=user&id=' . $this->user->id . '&auth_key=' . $this->user->auth_key;
return $this->localWSSUrl . '/?type=user&id=' . $this->user->id . '&auth_token=' . $this->user->getAuthToken();
}
/**
@@ -68,6 +68,27 @@ class WebSocketAPI
]);
}
/**
* @param int $itemID
* @param int $red
* @param int $green
* @param int $blue
* @param boolean $fade
* @return bool
* @internal param array $rgbData
*/
public function rgb($itemID, $red, $green, $blue, $fade)
{
return $this->send([
'type' => 'rgb',
'item_id' => $itemID,
'red' => $red,
'green' => $green,
'blue' => $blue,
'fade' => $fade,
]);
}
/**
* @param array $data
* @return bool