diff --git a/library/Phue/Command/CreateUser.php b/library/Phue/Command/CreateUser.php index c7de5ba..e8e320a 100644 --- a/library/Phue/Command/CreateUser.php +++ b/library/Phue/Command/CreateUser.php @@ -76,6 +76,12 @@ public function setUsername($username) */ public function setDeviceType($deviceType) { + if (strlen($deviceType) > 40) { + throw new \InvalidArgumentException( + "Device type must not have a length have more than 40 characters" + ); + } + $this->deviceType = (string) $deviceType; return $this;