Skip to content
Permalink
Browse files

add support "Simple devices"

  • Loading branch information...
Anisan committed Oct 1, 2019
1 parent 214b998 commit 00177034fc0fa1361dd654198e19d6981a1eb7b4
@@ -92,7 +92,15 @@
if ($properties[$i]['LINKED_OBJECT'] && $properties[$i]['LINKED_PROPERTY']) {
addLinkedProperty($properties[$i]['LINKED_OBJECT'], $properties[$i]['LINKED_PROPERTY'], $this->name);
}
}
}
if (file_exists(DIR_MODULES.'devices/devices.class.php')) {
if ($properties[$i]['TITLE']=='switch') {
$properties[$i]['SDEVICE_TYPE'] = 'relay';
}else {
$properties[$i]['SDEVICE_TYPE']='sensor_general';
}
}
}
$out['PROPERTIES']=$properties;
}
@@ -17,6 +17,7 @@
<tr>
<td><#LANG_TITLE#></td>
<td><#LANG_VALUE#></td>
<td><#LANG_DEVICE#></td>
<td><#LANG_LINKED_OBJECT#></td>
<td><#LANG_LINKED_PROPERTY#></td>
<td><#LANG_METHOD#></td>
@@ -27,6 +28,13 @@
<tr>
<td valign="top">[#TITLE#]</td>
<td valign="top">[#VALUE#]</td>
<td valign="top">
[#if SDEVICE_TYPE!=""#]
[#module name="devices" action="link" type="<#PROPERTIES.SDEVICE_TYPE#>" prefix="Sonoff" source_table="xicommands" source_table_id="<#PROPERTIES.ID#>" linked_object="<#PROPERTIES.LINKED_OBJECT#>"#]
[#else#]
&nbsp;
[#endif#]
</td>
<td valign="top"><input type="text" name="linked_object[#ID#]" id="linked_object[#ID#]" value="[#LINKED_OBJECT#]"></td>
<td valign="top"><input type="text" name="linked_property[#ID#]" id="linked_property[#ID#]" value="[#LINKED_PROPERTY#]"></td>
<td valign="top"><input type="text" name="linked_method[#ID#]" id="linked_method[#ID#]" value="[#LINKED_METHOD#]"></td>

0 comments on commit 0017703

Please sign in to comment.
You can’t perform that action at this time.