mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 05:01:57 +00:00
98_Hyperion: remove attr hyperionAttrRestore, default attributes just being added on define instead
git-svn-id: https://svn.fhem.de/fhem/trunk@12324 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e585cd6e52
commit
778191373c
@ -1,5 +1,7 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 98_Hyperion: removed attribute hyperionAttrRestore
|
||||||
|
default attributes just being added on define
|
||||||
- added: 73_NUKIBridge,74_NUKIDevice: New Modules to control Nuki Smartlocks
|
- added: 73_NUKIBridge,74_NUKIDevice: New Modules to control Nuki Smartlocks
|
||||||
- feature: 98_Hyperion: new attribute hyperionAttrRestore
|
- feature: 98_Hyperion: new attribute hyperionAttrRestore
|
||||||
readings will always be refreshed now
|
readings will always be refreshed now
|
||||||
|
@ -67,7 +67,6 @@ sub Hyperion_Initialize($)
|
|||||||
$hash->{SetFn} = "Hyperion_Set";
|
$hash->{SetFn} = "Hyperion_Set";
|
||||||
$hash->{UndefFn} = "Hyperion_Undef";
|
$hash->{UndefFn} = "Hyperion_Undef";
|
||||||
$hash->{AttrList} = "disable:1 ".
|
$hash->{AttrList} = "disable:1 ".
|
||||||
"hyperionAttrRestore:0 ".
|
|
||||||
"hyperionBin ".
|
"hyperionBin ".
|
||||||
"hyperionConfigDir ".
|
"hyperionConfigDir ".
|
||||||
"hyperionDefaultDuration ".
|
"hyperionDefaultDuration ".
|
||||||
@ -104,15 +103,28 @@ sub Hyperion_Define($$)
|
|||||||
$interval = 5 if ($interval && $interval < 5);
|
$interval = 5 if ($interval && $interval < 5);
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
Hyperion_OpenDev($hash);
|
Hyperion_OpenDev($hash);
|
||||||
if ($init_done)
|
if ($init_done && !defined $hash->{OLDDEF})
|
||||||
{
|
{
|
||||||
|
$attr{$name}{alias} = "Ambilight";
|
||||||
|
$attr{$name}{devStateIcon} = '{(Hyperion_devStateIcon($name),"toggle")}';
|
||||||
|
$attr{$name}{group} = "colordimmer";
|
||||||
|
$attr{$name}{homebridgeMapping} = $Hyperion_homebridgeMapping;
|
||||||
|
$attr{$name}{icon} = "light_led_stripe_rgb";
|
||||||
|
$attr{$name}{lightSceneParamsToSave} = "state";
|
||||||
|
$attr{$name}{room} = "Hyperion";
|
||||||
|
$attr{$name}{userattr} = "lightSceneParamsToSave"
|
||||||
|
if (index($attr{"global"}{userattr},"lightSceneParamsToSave") == -1);
|
||||||
|
$attr{$name}{userattr} = "homebridgeMapping"
|
||||||
|
if (!$attr{$name}{userattr} && index($attr{"global"}{userattr},"homebridgeMapping") == -1);
|
||||||
|
$attr{$name}{userattr} = "homebridgeMapping ".$attr{$name}{userattr}
|
||||||
|
if ($attr{$name}{userattr} && index($attr{"global"}{userattr},"homebridgeMapping") == -1 && index($attr{$name}{userattr},"homebridgeMapping") == -1);
|
||||||
|
$attr{$name}{webCmd} = $Hyperion_webCmd;
|
||||||
Hyperion_GetUpdate($hash);
|
Hyperion_GetUpdate($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InternalTimer(gettimeofday() + $interval,"Hyperion_GetUpdate",$hash,0);
|
InternalTimer(gettimeofday() + $interval,"Hyperion_GetUpdate",$hash,0);
|
||||||
}
|
}
|
||||||
$attr{$name}{room} = "Hyperion" if (!$attr{$name}{room});
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,41 +291,14 @@ sub Hyperion_Read($)
|
|||||||
my $satG = sprintf("%.3f",$trans->{saturationGain});
|
my $satG = sprintf("%.3f",$trans->{saturationGain});
|
||||||
my $satL = (defined $trans->{saturationLGain}) ? sprintf("%.3f",$trans->{saturationLGain}) : undef;
|
my $satL = (defined $trans->{saturationLGain}) ? sprintf("%.3f",$trans->{saturationLGain}) : undef;
|
||||||
my $valG = sprintf("%.3f",$trans->{valueGain});
|
my $valG = sprintf("%.3f",$trans->{valueGain});
|
||||||
my $attrRestore = AttrVal($name,"hyperionAttrRestore",1);
|
|
||||||
$Hyperion_sets_local{effect} = $effectList
|
$Hyperion_sets_local{effect} = $effectList
|
||||||
if (length $effectList > 0);
|
if (length $effectList > 0);
|
||||||
if ($configs)
|
if ($configs)
|
||||||
{
|
{
|
||||||
$Hyperion_sets_local{configFile} = $configs;
|
$Hyperion_sets_local{configFile} = $configs;
|
||||||
$attr{$name}{webCmd} = $Hyperion_webCmd_config
|
$attr{$name}{webCmd} = $Hyperion_webCmd_config
|
||||||
if ((!$attr{$name}{webCmd} || AttrVal($name,"webCmd","") eq $Hyperion_webCmd) && $attrRestore);
|
if (AttrVal($name,"webCmd","") eq $Hyperion_webCmd);
|
||||||
}
|
}
|
||||||
$attr{$name}{alias} = "Ambilight"
|
|
||||||
if (!$attr{$name}{alias} && $attrRestore);
|
|
||||||
$attr{$name}{devStateIcon} = '{(Hyperion_devStateIcon($name),"toggle")}'
|
|
||||||
if (!$attr{$name}{devStateIcon} && $attrRestore);
|
|
||||||
$attr{$name}{group} = "colordimmer"
|
|
||||||
if (!$attr{$name}{group} && $attrRestore);
|
|
||||||
$attr{$name}{homebridgeMapping} = $Hyperion_homebridgeMapping
|
|
||||||
if (!$attr{$name}{homebridgeMapping} && $attrRestore);
|
|
||||||
$attr{$name}{icon} = "light_led_stripe_rgb"
|
|
||||||
if (!$attr{$name}{icon} && $attrRestore);
|
|
||||||
$attr{$name}{lightSceneParamsToSave} = "state"
|
|
||||||
if (!$attr{$name}{lightSceneParamsToSave} && $attrRestore);
|
|
||||||
$attr{$name}{room} = "Hyperion"
|
|
||||||
if (!$attr{$name}{room} && $attrRestore);
|
|
||||||
$attr{$name}{userattr} = "lightSceneParamsToSave"
|
|
||||||
if (!$attr{$name}{userattr} && index($attr{"global"}{userattr},"lightSceneParamsToSave") == -1 && $attrRestore);
|
|
||||||
$attr{$name}{userattr} = "lightSceneParamsToSave ".$attr{$name}{userattr}
|
|
||||||
if ($attr{$name}{userattr} && index($attr{$name}{userattr},"lightSceneParamsToSave") == -1 && index($attr{"global"}{userattr},"lightSceneParamsToSave") == -1 && $attrRestore);
|
|
||||||
$attr{$name}{userattr} = "homebridgeMapping"
|
|
||||||
if (!$attr{$name}{userattr} && index($attr{"global"}{userattr},"homebridgeMapping") == -1 && $attrRestore);
|
|
||||||
$attr{$name}{userattr} = "homebridgeMapping ".$attr{$name}{userattr}
|
|
||||||
if ($attr{$name}{userattr} && index($attr{$name}{userattr},"homebridgeMapping") == -1 && index($attr{"global"}{userattr},"homebridgeMapping") == -1 && $attrRestore);
|
|
||||||
$attr{$name}{webCmd} = $Hyperion_webCmd
|
|
||||||
if ((!$attr{$name}{webCmd} || ($attr{$name}{webCmd} && !$Hyperion_sets_local{configFile})) && $attrRestore);
|
|
||||||
$attr{$name}{webCmd} = $Hyperion_webCmd_config
|
|
||||||
if ($attr{$name}{webCmd} && $Hyperion_sets_local{configFile} && $attr{$name}{webCmd} eq $Hyperion_webCmd && $attrRestore);
|
|
||||||
$hash->{helper}{sets} = join(" ",map {"$_:$Hyperion_sets_local{$_}"} keys %Hyperion_sets_local);
|
$hash->{helper}{sets} = join(" ",map {"$_:$Hyperion_sets_local{$_}"} keys %Hyperion_sets_local);
|
||||||
$hash->{hostname} = $data->{hostname}
|
$hash->{hostname} = $data->{hostname}
|
||||||
if (($data->{hostname} && !$hash->{hostname}) || ($data->{hostname} && $hash->{hostname} ne $data->{hostname}));
|
if (($data->{hostname} && !$hash->{hostname}) || ($data->{hostname} && $hash->{hostname} ne $data->{hostname}));
|
||||||
@ -445,8 +430,7 @@ sub Hyperion_GetConfigs($)
|
|||||||
my $configs = join(",",@files);
|
my $configs = join(",",@files);
|
||||||
readingsSingleUpdate($hash,".configs",$configs,1)
|
readingsSingleUpdate($hash,".configs",$configs,1)
|
||||||
if (ReadingsVal($name,".configs","") ne $configs);
|
if (ReadingsVal($name,".configs","") ne $configs);
|
||||||
$attr{$name}{webCmd} = $Hyperion_webCmd_config
|
$attr{$name}{webCmd "webCmd","") eq $Hyperion_webCmd);
|
||||||
if (AttrVal($name,"webCmd","") eq $Hyperion_webCmd);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -799,11 +783,6 @@ sub Hyperion_Attr(@)
|
|||||||
$err = "Invalid value $attr_value for attribute $attr_name. Must be between 1 and 50 in steps of 1, default is 5."
|
$err = "Invalid value $attr_value for attribute $attr_name. Must be between 1 and 50 in steps of 1, default is 5."
|
||||||
if ($attr_value !~ /^(\d+)$/ || $1 < 1 || $1 > 50);
|
if ($attr_value !~ /^(\d+)$/ || $1 < 1 || $1 > 50);
|
||||||
}
|
}
|
||||||
elsif ($attr_name eq "hyperionAttrRestore")
|
|
||||||
{
|
|
||||||
$err = "Invalid value $attr_value for attribute $attr_name. Can only be value 0."
|
|
||||||
if ($attr_value !~ /^0$/);
|
|
||||||
}
|
|
||||||
elsif ($attr_name eq "hyperionNoSudo")
|
elsif ($attr_name eq "hyperionNoSudo")
|
||||||
{
|
{
|
||||||
$err = "Invalid value $attr_value for attribute $attr_name. Can only be value 1."
|
$err = "Invalid value $attr_value for attribute $attr_name. Can only be value 1."
|
||||||
@ -1052,11 +1031,6 @@ sub Hyperion_devStateIcon($;$)
|
|||||||
<a name="Hyperion_attr"></a>
|
<a name="Hyperion_attr"></a>
|
||||||
<p><b>Attributes</b></p>
|
<p><b>Attributes</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
|
||||||
<i>hyperionAttrRestore</i><br>
|
|
||||||
restore default attributes if deleted manually<br>
|
|
||||||
default: 1
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<i>hyperionBin</i><br>
|
<i>hyperionBin</i><br>
|
||||||
path to the hyperion executable<br>
|
path to the hyperion executable<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user