2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

proper colorpicker registration in Color.pm

git-svn-id: https://svn.fhem.de/fhem/trunk@3902 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2013-09-14 16:38:36 +00:00
parent 7aa882f9fb
commit 6fa38ab5f7
3 changed files with 10 additions and 5 deletions

View File

@ -66,8 +66,7 @@ sub HUEDevice_Initialize($)
#$hash->{FW_summaryFn} = "HUEDevice_summaryFn";
$data{webCmdFn}{colorpicker} = "FHEM_colorpickerFn";
$data{FWEXT}{"/"}{SCRIPT} = "/jscolor/jscolor.js";
FHEM_colorpickerInit();
}
sub
@ -531,7 +530,7 @@ HUEDevice_GetUpdate($)
if( !defined( $attr{$name}{webCmd} ) ) {
$attr{$name}{webCmd} = 'rgb:rgb ff0000:rgb 98FF23:rgb 0000ff:toggle:on:off' if( $attr{$name}{subType} eq "colordimmer" );
$attr{$name}{webCmd} = 'rgb:rgb ff0000:rgb C8FF12:rgb 0000ff:toggle:on:off' if( AttrVal($name, "model", "") eq "LCT001" );
$attr{$name}{webCmd} = 'rgb:rgb ff0000:rgb DEFF26:rgb 0000ff:toggle:on:off' if( AttrVal($name, "model", "") eq "LCT001" );
$attr{$name}{webCmd} = 'pct:toggle:on:off' if( $attr{$name}{subType} eq "dimmer" );
$attr{$name}{webCmd} = 'toggle:on:off' if( $attr{$name}{subType} eq "switch" );
}

View File

@ -73,8 +73,7 @@ SWAP_0000002200000003_Initialize($)
#$hash->{FW_summaryFn} = "SWAP_0000002200000003_summaryFn";
$data{webCmdFn}{colorpicker} = "FHEM_colorpickerFn";
$data{FWEXT}{"/"}{SCRIPT} = "/jscolor/jscolor.js";
FHEM_colorpickerInit();
return $ret;
}

View File

@ -6,6 +6,13 @@ package main;
use strict;
use warnings;
sub
FHEM_colorpickerInit()
{
$data{webCmdFn}{colorpicker} = "FHEM_colorpickerFn";
$data{FWEXT}{colorpicker}{SCRIPT} = "/jscolor/jscolor.js";
}
sub
FHEM_colorpickerFn($$$)
{