# $Id$ package main; use strict; use warnings; sub Color_Initialize() { FHEM_colorpickerInit(); } sub FHEM_colorpickerInit() { $data{webCmdFn}{colorpicker} = "FHEM_colorpickerFn"; $data{FWEXT}{colorpicker}{SCRIPT} = "/jscolor/jscolor.js"; } sub FHEM_colorpickerFn($$$) { my ($FW_wname, $d, $FW_room, $cmd, $values) = @_; my @args = split("[ \t]+", $cmd); return undef if($values !~ m/^colorpicker,(.*)$/); my ($mode) = ($1); $mode = "RGB" if( !defined($mode) ); my $srf = $FW_room ? "&room=$FW_room" : ""; my $cv = CommandGet("","$d $cmd"); $cmd = "" if($cmd eq "state"); if( $args[1] ) { my $c = "cmd=set $d $cmd$srf"; return ''. "
'. '' if( AttrVal($FW_wname, "longpoll", 1)); return ''. "". '
'. '
'. ''; } else { my $c = "$FW_ME?XHR=1&cmd=set $d $cmd %$srf"; return ''. "". ''; } } 1;