mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
bugfix: 31_MilightDevice: if we're already off don't turn on to set dim level!
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@7807 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0392cc0a22
commit
fe8bca40b9
1
CHANGED
1
CHANGED
@ -1,5 +1,6 @@
|
||||
# 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.
|
||||
- bugfix: 31_MilightDevice: if we're already off don't turn on to set dim level!
|
||||
- added: new dustbin icon
|
||||
- bugfix: SYSMON: some warnings
|
||||
- changed: SYSMON: documentation
|
||||
|
@ -672,11 +672,15 @@ sub MilightDevice_RGB_Off(@)
|
||||
if (ReadingsVal($hash->{NAME}, "state", "off") ne "off")
|
||||
{
|
||||
readingsSingleUpdate($hash, "brightness_on", ReadingsVal($hash->{NAME}, "brightness", 100), 1);
|
||||
# Dim down to min brightness then send off command (avoid flicker on turn on)
|
||||
MilightDevice_RGB_Dim($hash, 100/MilightDevice_DimSteps($hash), $ramp, $flags);
|
||||
return MilightDevice_RGB_Dim($hash, 0, 0, 'q');
|
||||
}
|
||||
else
|
||||
{
|
||||
# If we are already off just send the off command again
|
||||
return MilightDevice_RGB_Dim($hash, 0, 0, '');
|
||||
}
|
||||
|
||||
# Dim down to min brightness then send off command (avoid flicker on turn on)
|
||||
MilightDevice_RGB_Dim($hash, 100/MilightDevice_DimSteps($hash), $ramp, $flags);
|
||||
return MilightDevice_RGB_Dim($hash, 0, 0, 'q');
|
||||
}
|
||||
|
||||
#####################################
|
||||
@ -837,11 +841,15 @@ sub MilightDevice_RGBW_Off(@)
|
||||
if (ReadingsVal($hash->{NAME}, "state", "off") ne "off")
|
||||
{
|
||||
readingsSingleUpdate($hash, "brightness_on", ReadingsVal($hash->{NAME}, "brightness", 100), 1);
|
||||
# Dim down to min brightness then send off command (avoid flicker on turn on)
|
||||
MilightDevice_RGBW_Dim($hash, 100/MilightDevice_DimSteps($hash), $ramp, $flags);
|
||||
return MilightDevice_RGBW_Dim($hash, 0, 0, 'q');
|
||||
}
|
||||
else
|
||||
{
|
||||
# If we are already off just send the off command again
|
||||
return MilightDevice_RGBW_Dim($hash, 0, 0, '');
|
||||
}
|
||||
|
||||
# Dim down to min brightness then send off command (avoid flicker on turn on)
|
||||
MilightDevice_RGBW_Dim($hash, 100/MilightDevice_DimSteps($hash), $ramp, $flags);
|
||||
return MilightDevice_RGBW_Dim($hash, 0, 0, 'q');
|
||||
}
|
||||
|
||||
#####################################
|
||||
@ -1065,10 +1073,15 @@ sub MilightDevice_White_Off(@)
|
||||
if (ReadingsVal($hash->{NAME}, "state", "off") ne "off")
|
||||
{
|
||||
readingsSingleUpdate($hash, "brightness_on", ReadingsVal($hash->{NAME}, "brightness", 100), 1);
|
||||
# Dim down to min brightness then send off command (avoid flicker on turn on)
|
||||
MilightDevice_White_Dim($hash, 100/MilightDevice_DimSteps($hash), $ramp, $flags);
|
||||
return MilightDevice_White_Dim($hash, 0, 0, 'q');
|
||||
}
|
||||
else
|
||||
{
|
||||
# If we are already off just send the off command again
|
||||
return MilightDevice_White_Dim($hash, 0, 0, '');
|
||||
}
|
||||
# Dim down to min brightness then send off command (avoid flicker on turn on)
|
||||
MilightDevice_White_Dim($hash, 100/MilightDevice_DimSteps($hash), $ramp, $flags);
|
||||
return MilightDevice_White_Dim($hash, 0, 0, 'q');
|
||||
}
|
||||
|
||||
#####################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user