diff --git a/lib/AoGSmartHome_Items.pm b/lib/AoGSmartHome_Items.pm index e57290fd8..3c4d67997 100644 --- a/lib/AoGSmartHome_Items.pm +++ b/lib/AoGSmartHome_Items.pm @@ -779,7 +779,16 @@ sub execute_OnOff { my $response = ' { "ids": ['; - my $turn_on = $command->{'execution'}->[0]->{'params'}->{'on'} eq "true" ? 1 : 0; + my $turn_on; + + &main::print_log( "Received execut command " . $command->{'execution'}->[0]->{'params'}->{'on'} ); + if( $command->{'execution'}->[0]->{'params'}->{'on'} == 1 + || $command->{'execution'}->[0]->{'params'}->{'on'} eq "true" + ) { + $turn_on = 1; + } else { + $turn_on = 0; + } foreach my $device ( @{ $command->{'devices'} } ) { set_state( $self, $device->{'id'}, $turn_on ? 'on' : 'off' ); @@ -1060,4 +1069,4 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -=cut \ No newline at end of file +=cut