Hello admin,
Fan Didn't Spin in the first time, after second change or browser refresh it become ok!
here is the JS I used:
Another issue I faced:
I used This Rotate JS Code:
But I added another JS Code to Enable/Disable read only property, Because these objects controlled by Motion sensors but I want to give the user control in case of Motion failure.
But when objects changed to Read only by the following JS; rotate malfunction
Fan Didn't Spin in the first time, after second change or browser refresh it become ok!
here is the JS I used:
Code:
// Spin/High Speed Fan
$(function(){
if (window.grp) {
function listen(i) {
grp.listen('1/7/' + i, function(object) {
$('.spin-animation.item-read-only')
.removeClass('item-read-only')
.css('pointer-events', 'none');
$('.spin-' +i).toggleClass('spin-animation', object.value == true);
});
}
for (var i = 1; i <= 40; i++) {
listen(i);
}
}
});
Another issue I faced:
I used This Rotate JS Code:
Code:
// Rotate
$(function(){
$('[class*=rotate-]').each(function(index, el) {
var match = el.className.match(/rotate\-(\d+)/);
el.style.transform = 'rotate(' + match[1] + 'deg';
});
});
But I added another JS Code to Enable/Disable read only property, Because these objects controlled by Motion sensors but I want to give the user control in case of Motion failure.
But when objects changed to Read only by the following JS; rotate malfunction
Code:
$(function(){
grp.listen('50/5/21', function(object) {
if (object.value == true ) {
$(".lockbyknx").addClass("item-read-only");
} else if (object.value == false ) {
$(".lockbyknx").removeClass("item-read-only");
}
});
});
Best Regards,