Skip to content

Commit

Permalink
Added an extra check for null for button states
Browse files Browse the repository at this point in the history
  • Loading branch information
knowthelist committed Mar 17, 2015
1 parent 75e575c commit 859cf49
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions js/fhem-tablet-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,16 @@ function update(filter) {
else if (deviceType == 'switch' || deviceType == 'contact'){

var state = getDeviceValue( $(this), 'get' );

if ( state == $(this).data('get-on') )
$(this).data('famultibutton').setOn();
else if ( state == $(this).data('get-off') )
$(this).data('famultibutton').setOff();
else if ( state.match(RegExp('^' + $(this).data('get-on') + '$')) )
$(this).data('famultibutton').setOn();
else if ( state.match(RegExp('^' + $(this).data('get-off') + '$')) )
$(this).data('famultibutton').setOff();
if (state) {
if ( state == $(this).data('get-on') )
$(this).data('famultibutton').setOn();
else if ( state == $(this).data('get-off') )
$(this).data('famultibutton').setOff();
else if ( state.match(RegExp('^' + $(this).data('get-on') + '$')) )
$(this).data('famultibutton').setOn();
else if ( state.match(RegExp('^' + $(this).data('get-off') + '$')) )
$(this).data('famultibutton').setOff();
}
}
});
ready = true;
Expand Down

0 comments on commit 859cf49

Please sign in to comment.