mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-12 02:04:34 +00:00
Google Home Bether Working
This commit is contained in:
1 parent
8b39b727e1
commit
23aa83ec9a
5 files changed
+128
-55
No files matched your search
@@ -2,6 +2,19 @@
|
||||
class RecordManager{
|
||||
public static $records;
|
||||
|
||||
public static function createWithSubId ($subDeviceId, $value) {
|
||||
$record = array (
|
||||
'subdevice_id' => $subDeviceId,
|
||||
'value' => $value,
|
||||
);
|
||||
try {
|
||||
return Db::add ('records', $record);
|
||||
} catch(PDOException $error) {
|
||||
echo $error->getMessage();
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
public static function create ($deviceId, $type, $value) {
|
||||
$subDeviceId = Db::loadOne('SELECT * FROM subdevices WHERE device_id = ? AND type = ?;', array($deviceId, $type))['subdevice_id'];
|
||||
if ($subDeviceId == '') {
|
||||
@@ -19,6 +32,7 @@ class RecordManager{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function setExecuted($recordId) {
|
||||
try {
|
||||
Db::edit ('records', ['execuded' => 1], 'WHERE record_id = ?', array($recordId));
|
||||
|
||||
Reference in new issue
Block a user