Browse Source

UPD: BlinkSpecial use only latest api version

Giancarlo Voci 7 years ago
parent
commit
10293d3697
1 changed files with 4 additions and 31 deletions
  1. 4 31
      src/OpenMind/FindBox/SmartESL.php

+ 4 - 31
src/OpenMind/FindBox/SmartESL.php

@@ -60,44 +60,17 @@ class SmartESL
 	 * @param int $repeat
 	 * @param int $repeat
 	 * @param int $iter_time
 	 * @param int $iter_time
 	 * @param int $iterations
 	 * @param int $iterations
-	 * @param int|null $ledColor
+	 * @param int|0 $ledColor
 	 * @return array
 	 * @return array
 	 */
 	 */
-	public function BlinkSpecial(int $pattern, int $repeat, int $iter_time, int $iterations, int $ledColor = null)
+	public function BlinkSpecial(int $pattern, int $repeat, int $iter_time, int $iterations, int $ledColor = 0)
 	{
 	{
-		$numLeds = $this->getData()['led'];
-		switch ($numLeds) {
-			case 2:
-				$version = 4;
-				break;
-			case 4:
-				$version = 6;
-				break;
-			default:
-				$version = 3;
-				break;
-		}
-		$firmwareStringVersion = array(
-			'3' => '1.0.0',
-			'4' => '1.1.0',
-			'6' => '2.0.0'
-		);
-
-		$params = array(
-			'3' => array($pattern, $repeat, $iter_time, $iterations, 1),
-			'4' => array($pattern, $repeat, $iter_time, $iterations, 1),
-			'6' => array($pattern, $ledColor, $repeat, $iter_time, $iterations, 1)
-
-		);
-
-		// TODO #NODISPLAY da sistemare
-		$strFWVer = $firmwareStringVersion[$version];
 
 
 		$uriParams = json_encode(array_merge(
 		$uriParams = json_encode(array_merge(
 			array($this->labels),
 			array($this->labels),
-			$params[$version]));
+			array($pattern, $ledColor, $repeat, $iter_time, $iterations, 1)));
 
 
-		$URI = "/1.0.0/index.php/smartesl.blink_special/{$strFWVer}/";
+		$URI = "/1.0.0/index.php/smartesl.blink_special/2.0.0/";
 		return $this->core->CallAPI($URI, $uriParams);
 		return $this->core->CallAPI($URI, $uriParams);
 	}
 	}