mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Few Fixes After infrastructure migration
This commit is contained in:
1 parent
32521d0ed3
commit
30da6e162b
5 files changed
+23
-13
No files matched your search
@@ -12,7 +12,7 @@ class WidgetApi extends ApiController{
|
||||
$subDeviceData = SubDeviceManager::getSubDevice($subDeviceId);
|
||||
if ($subDeviceData['type'] == 'on/off'){
|
||||
$lastValue = RecordManager::getLastRecord($subDeviceData['subdevice_id'])['value'];
|
||||
RecordManager::create($subDeviceData['device_id'], 'on/off', !$lastValue);
|
||||
RecordManager::create($subDeviceData['device_id'], 'on/off', (int) !$lastValue);
|
||||
$response = !$lastValue;
|
||||
} else {
|
||||
throw new Exception("Bad Request", 403);
|
||||
|
||||
Reference in new issue
Block a user