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