feat(devices): add some aqara devices
Added Aqara temperature/humidity, switch and window magnet
This commit is contained in:
@@ -95,7 +95,7 @@
|
||||
<dt>payload
|
||||
<span class="property-type">json</span>
|
||||
</dt>
|
||||
<dd>Gateway <code>switch</code> message of type <code>read_ack</code>, <code>heartbeat</code> or <code>report</code></dd>
|
||||
<dd>Gateway <code>switch</code> and <code>sensor_switch.aq2</code> message of type <code>read_ack</code>, <code>heartbeat</code> or <code>report</code></dd>
|
||||
</dl>
|
||||
|
||||
<h3>Outputs</h3>
|
||||
@@ -115,7 +115,7 @@
|
||||
</ol>
|
||||
|
||||
<h3>Details</h3>
|
||||
<p>The incoming json message is parsed if the type model is <code>switch</code> and
|
||||
<p>The incoming json message is parsed if the type model is <code>switch</code> or <code>sensor_switch.aq2</code> and
|
||||
the <code>sid</code> matches the configured value for this device.</p>
|
||||
<p>Three output types are supported:
|
||||
<ul>
|
||||
|
||||
@@ -19,7 +19,7 @@ module.exports = function(RED) {
|
||||
// var payload = JSON.parse(msg);
|
||||
var payload = msg.payload;
|
||||
|
||||
if (payload.sid == node.sid && payload.model == "switch") {
|
||||
if (payload.sid == node.sid && ["switch", "sensor_switch.aq2"].indexOf(payload.model) >= 0) {
|
||||
var data = JSON.parse(payload.data)
|
||||
|
||||
if (data.voltage) {
|
||||
|
||||
Reference in New Issue
Block a user