Here’s a small extension script that shows the change in behavior.
This would previously display two buttons to “control” player 1 and player 2. Both are available to add as external controls but are no longer displayed un v 1.8.
var RoonApi = require(“node-roon-api”),
RoonApiStatus = require("node-roon-api-status"),
RoonApiSourceControl = require("node-roon-api-source-control"),
RoonApiTransport = require("node-roon-api-transport");
var roon = new RoonApi({
extension_id: '',
display_name: "Roon API Test - Source Control v 1.8",
display_version: "1.0.0",
publisher: '',
email: '',
website: '',
log_level: 'none',
core_paired: function(core) {
let transport = core.services.RoonApiTransport;
transport.subscribe_zones(function(cmd, data) {
console.log(core.core_id,
core.display_name,
core.display_version)
})
},
core_unpaired: function(core) {
console.log(core.core_id,
core.display_name,
core.display_version,
"-",
"LOST");
}
});
var svc_status = new RoonApiStatus(roon);
var svc_source_control = new RoonApiSourceControl(roon);
roon.init_services({
required_services: [ RoonApiTransport ],
provided_services: [svc_status, svc_source_control ]
});
svc_status.set_status(“All is good”, false);
roon.start_discovery();
svc_source_control.new_device(test_source_control_1())
svc_source_control.new_device(test_source_control_2())
function test_source_control_1 () {
const control = {
state: {
control_key: 1001,
display_name: "PLAYER 1",
supports_standby: true,
status: "selected",
},
convenience_switch : function (req) {
console.log("PLAYER 1 CONVENIENCE SWITCHED ")
req.send_complete("Success")
},
standby: function (req) {
console.log("PLAYER 1 STANDBY ")
req.send_complete("Success")
}
}
return (control)
}
function test_source_control_2 () {
const control = {
state: {
control_key: 1002,
display_name: "PLAYER 2",
supports_standby: true,
status: "selected",
},
convenience_switch : function (req) {
console.log("PLAYER 2 CONVENIENCE SWITCHED ")
req.send_complete("Success")
},
standby: function (req) {
console.log("PLAYER STANDBY 2 ")
req.send_complete("Success")
}
}
return (control)
}