Skip to content

Commit 962a362

Browse files
committed
UPDATE catch exception
1 parent 4cce999 commit 962a362

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/Traits/Light.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,16 @@ public function getBrightnessAndRgb(Device $device)
9292
{
9393
$this->miIO->send($device, 'get_prop', ['rgb']);
9494

95-
return $this->miIO->read($device)->done(function ($response) {
96-
if ($response instanceof Response) {
97-
return dechex($response->getResult()[0]);
98-
}
99-
100-
return null;
101-
});
95+
return $this->miIO->read($device)
96+
->done(function ($response) {
97+
if ($response instanceof Response) {
98+
return dechex($response->getResult()[0]);
99+
}
100+
101+
return null;
102+
}, function ($rejected) {
103+
// TODO: error handling
104+
});
102105
}
103106

104107
/**

0 commit comments

Comments
 (0)