Skip to content

Commit

Permalink
Addresses #95 identified inconsistancy with msg.platform output
Browse files Browse the repository at this point in the history
  • Loading branch information
i8beef committed Sep 5, 2023
1 parent a146aeb commit 7eaa633
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions castv2-sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,11 @@ module.exports = function(RED) {

node.receiver.on("status", function(status) {
if (status) {
const msg = { _castTarget: node.clientNode.connectedIp, payload: status };
const msg = {
_castTarget: node.clientNode.connectedIp,
platform: node.clientNode.platformStatus,
payload: status
};
node.send(msg);
}
});
Expand All @@ -453,7 +457,11 @@ module.exports = function(RED) {
node.receiver.getStatusAsync()
.then(status => {
if (status) {
const msg = { _castTarget: node.clientNode.connectedIp, payload: status };
const msg = {
_castTarget: node.clientNode.connectedIp,
platform: node.clientNode.platformStatus,
payload: status
};
node.send(msg);
}
});
Expand Down Expand Up @@ -686,7 +694,8 @@ module.exports = function(RED) {
send(msg);
} else if (msg.payload.type === "GET_STATUS") {
RED.util.setMessageProperty(msg, "_castTarget", node.clientNode.connectedIp);
RED.util.setMessageProperty(msg, "platform", status);
RED.util.setMessageProperty(msg, "platform", node.clientNode.platformStatus);
RED.util.setMessageProperty(msg, "payload", status);
send(msg);
}

Expand Down

0 comments on commit 7eaa633

Please sign in to comment.