Get All types of senzor for master devices function addet to subdevice manager

This commit is contained in:
JonatanRek 2019-10-09 10:56:46 +02:00
parent 97e2eaf6ec
commit 32c5d7feda

View File

@ -36,6 +36,16 @@ class SubDeviceManager
return Db::loadOne("SELECT * FROM subdevices WHERE subdevice_id = ?;", array($subDeviceId)); return Db::loadOne("SELECT * FROM subdevices WHERE subdevice_id = ?;", array($subDeviceId));
} }
public function getSubDevicesTypeForMater($deviceId)
{
$parsedTypes = [];
$types = Db::loadAll("SELECT type FROM subdevices WHERE device_id = ?;", array($deviceId));
foreach ($types as $orderNum => $type) {
$parsedTypes[$orderNum] = $type['type'];
}
return $parsedTypes;
}
//check if dubdevice exist //check if dubdevice exist
public function create($deviceId, $type, $unit) public function create($deviceId, $type, $unit)