-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmy notate.txt
43 lines (39 loc) · 2.68 KB
/
my notate.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
https://github.com/jloutsenhizer/CR-Cast/wiki/Chromecast-Implementation-Documentation-WIP
// если устройство yeelight
if (substr($deviceInfo['location'], 0, 9) == "yeelight:")
{
$control_url = str_ireplace("yeelight:", "http:", $deviceInfo['location']);
// проверяем на наличие в базе для запрета вывода
$uuid = $deviceInfo['location'];
$existed = SQLSelectOne("SELECT * FROM $table_name WHERE UUID='" . $uuid . "'");
// need for chek device type
$device_type = 'YeelightSmartBulb'; //DeviceType
$services = 'YeelightSmartBulb'; //DeviceServices
// проверяем на наличие модуля в системе
$mod_cheked = SQLSelectOne("SELECT * FROM plugins WHERE MODULE_NAME LIKE '" . $modules['YeelightSmartBulb'] . "'");
if (!array_search_result($result, 'UUID', $uuid) && !is_null($uuid) && !($existed))
{
$result[] = [
"ID" => $existed["ID"], //existed id Majordomo
"TITLE" => 'Yeelight bulb', //friendly name
"ADDRESS" => 'https://www.yeelight.com', //presentation url (web UI of device),//presentation url (web UI of device)
"UUID" => $deviceInfo['location'],
"LOGO" => "/templates/ssdp_finder/img/YeelightSmartBulb.png", //Logo
"DESCRIPTION" => 'Yeelight WiFi Light', //description get from xml or field "server"
"TYPE" => $device_type, //DeviceType
"SERIAL" => 'not existed', //serialnumber
"MANUFACTURERURL" => 'https://www.yeelight.com', //manufacturer url
"UPDATED" => '', "MODEL" => 'not existed', //model
"MODELNUMBER" => 'not existed', //modelNumber
"MANUFACTURER" => 'YeelightSmartBulb', //Manufacturer
"SERVICES" => $services, //list services of device
"CONTROLADDRESS" => $control_url, //list services of device
"EXTENDED_MODULES" => $modules[$device_type], // проверка на наличие модуля
"MODULE_INSTALLED" => $mod_cheked, //chek the installed module
"EXTENDED_SIMPLEDEVICE" => check_seample_device($device_type) , //chek the simple device extended
];
$_SESSION[$uuid] = $logo;
}
}
else // иначе проверяем остальные устройства
{