Is it possible to change the btnimage and url for a button depending on the data of another block.
I have a block "Yamaha_AlbumArt". I want the data of this block is the input for the btnimage and url.
Data is for example "http://x.x.x.x/YamahaRemoteControl/Albu ... RT8175.png".
Below an example, but this doesn't work:
config.js
blocks['Yamaha_AlbumArt'] = {
idx: 2636,
last_update: false,
width: 4,
}
buttons.yamahaalbum = {
width: 3,
key: 'yamahaalbum',
forcerefresh:1,
isimage: true,
refresh: 5,
}
custom.js
function getStatus_Yamaha_AlbumArt(block) {
var idx = block.idx;
var device = block.device;
console.log(device.Data);
Dashticz.setBlock("buttons.yamahaalbum", {
image: device.Data,
});
}
Change button image/url depends data other block Topic is solved
Moderators: leecollings, htilburgs, robgeerts
-
michelscholte
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
-
Lokonli
- Posts: 2296
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Change button image/url depends data other block
Code: Select all
function getStatus_Yamaha_AlbumArt(block) {
var idx = block.idx;
var device = block.device;
console.log(device.Data);
Dashticz.setBlock("yamahaalbum", {
btnimage: device.Data,
});
}
-
michelscholte
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
Re: Change button image/url depends data other block
Great. This works.
Thanks again.
Thanks again.