We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is an Error shown for (as I suspect) inactive devices. Error message (edited): ERROR: catched exception Notice: Undefined property: stdClass::$hue ["Message: Notice: Undefined property: stdClass::$hue\nStack Trace: #0 vendor/sqmk/phue/library/Phue/Light.php(268): Symfony\Component\Debug\ErrorHandler->handleError(8, 'Undefined prope...', '/Users/xxx/...', 268, Array)\n #1 src/SomeClass: Phue\Light->getHue()\n
Location: sqmk/phue/library/Phue/Light.php(268)
public function getHue() { return $this->attributes->state->hue; }
While debugging, the following properties are shown (correct scenario) : $this = {Phue\Light} [3] id = 1 attributes = {stdClass} [7] state = {stdClass} [10] on = false bri = 143 hue = 0 sat = 0 effect = "none" xy = {array} [2] ct = 370 alert = "none" colormode = "xy" reachable = false type = "someString" name = "someString" modelid = "someString" manufacturername = "Philips" uniqueid = "someId" swversion = "someversion" swconfigid = "someConfigId" productid = "someProductId" client = {Phue\Client} [3]
So hue = 0 is a proper object with a proper value.
Incorrect scenario (inactive hue device): $this = {Phue\Light} [3] id = 7 attributes = {stdClass} [9] state = {stdClass} [6] on = false bri = 127 ct = 370 alert = "none" colormode = "ct" reachable = false type = "someString" name = "someString" modelid = "someString" manufacturername = "Philips" uniqueid = "someId" swversion = "someversion" swconfigid = "someConfigId" productid = "someProductId" client = {Phue\Client} [3]
The object hue is missing here, I guess because of the inactive device, and the error message above is caused.
maybe you could edit this function a bit, so the returned value will be an int or null
public function getHue() { $hue = $this->attributes->state->hue; return (isset($hue)) ? $hue : null; }
or maybe just return "0" ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
There is an Error shown for (as I suspect) inactive devices.
Error message (edited):
ERROR: catched exception Notice: Undefined property: stdClass::$hue ["Message: Notice: Undefined property: stdClass::$hue\nStack Trace:
#0 vendor/sqmk/phue/library/Phue/Light.php(268): Symfony\Component\Debug\ErrorHandler->handleError(8, 'Undefined prope...', '/Users/xxx/...', 268, Array)\n
#1 src/SomeClass: Phue\Light->getHue()\n
Location:
sqmk/phue/library/Phue/Light.php(268)
While debugging, the following properties are shown (correct scenario) :
$this = {Phue\Light} [3]
id = 1
attributes = {stdClass} [7]
state = {stdClass} [10]
on = false
bri = 143
hue = 0
sat = 0
effect = "none"
xy = {array} [2]
ct = 370
alert = "none"
colormode = "xy"
reachable = false
type = "someString"
name = "someString"
modelid = "someString"
manufacturername = "Philips"
uniqueid = "someId"
swversion = "someversion"
swconfigid = "someConfigId"
productid = "someProductId"
client = {Phue\Client} [3]
So hue = 0 is a proper object with a proper value.
Incorrect scenario (inactive hue device):
$this = {Phue\Light} [3]
id = 7
attributes = {stdClass} [9]
state = {stdClass} [6]
on = false
bri = 127
ct = 370
alert = "none"
colormode = "ct"
reachable = false
type = "someString"
name = "someString"
modelid = "someString"
manufacturername = "Philips"
uniqueid = "someId"
swversion = "someversion"
swconfigid = "someConfigId"
productid = "someProductId"
client = {Phue\Client} [3]
The object hue is missing here, I guess because of the inactive device, and the error message above is caused.
maybe you could edit this function a bit, so the returned value will be an int or null
or maybe just return "0" ?
The text was updated successfully, but these errors were encountered: