mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
88_Timer: fix list "Probably associated with" Forum: #1015549
git-svn-id: https://svn.fhem.de/fhem/trunk@21032 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1f159aa0a1
commit
f2e909a985
@ -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: 88_Timer: fix list "Probably associated with" Forum: #1015549
|
||||
- bugfix: 74_NUKIDevice: fix FHEM Crash
|
||||
Undefined subroutine &FHEM::NUKIDevice::CommandDefMod
|
||||
- change: 73_AutoShuttersControl: change commandref
|
||||
|
@ -9,7 +9,7 @@
|
||||
# https://forum.fhem.de/index.php/board,20.0.html
|
||||
# https://forum.fhem.de/index.php/topic,103848.html | https://forum.fhem.de/index.php/topic,103986.0.html
|
||||
#
|
||||
# 2019 - HomeAuto_User & elektron-bbs
|
||||
# 2019 | 2020 - HomeAuto_User, elektron-bbs
|
||||
#################################################################
|
||||
# notes:
|
||||
# - module mit package umsetzen
|
||||
@ -804,6 +804,27 @@ sub FW_pushed_savebutton {
|
||||
readingsBulkUpdate($hash, "state" , $state, 1);
|
||||
readingsEndUpdate($hash, 1);
|
||||
|
||||
## Probably associated with - added to list ##
|
||||
### check must work after changed setreadings to new value ###
|
||||
## all device must check, for right value in .associatedWith
|
||||
my $associatedWith = ReadingsVal($name, ".associatedWith", "");
|
||||
|
||||
foreach my $d (sort keys %{$hash->{READINGS}}) {
|
||||
if ($d =~ /^Timer_(\d+)$/) {
|
||||
my @values = split("," , ReadingsVal($name, $d, ""));
|
||||
if ($values[7] ne "DEF") {
|
||||
#Log3 $name, 5, "$name: FW_pushed_savebutton | Reading .associatedWith check: ".$values[6]." with ".$values[7];
|
||||
if (not grep /$values[6]/, $associatedWith) {
|
||||
#Log3 $name, 5, "$name: FW_pushed_savebutton | Reading .associatedWith added ".$values[6];
|
||||
$associatedWith = $associatedWith eq "" ? $values[6] : $associatedWith.",".$values[6];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Log3 $name, 5, "$name: FW_pushed_savebutton | Reading .associatedWith is: ".$associatedWith;
|
||||
CommandSetReading(undef, "$name .associatedWith $associatedWith");
|
||||
## current list "Probably associated with" finish ##
|
||||
|
||||
## popup user message (jump to javascript) ##
|
||||
if ($popup != 0) {
|
||||
FW_directNotify("FILTER=(room=)?$name", "#FHEMWEB:WEB", "show_popup(".$selected_buttons[0].")", "");
|
||||
@ -907,7 +928,8 @@ sub Timer_Check($) {
|
||||
if ($set == 1) {
|
||||
Log3 $name, 4, "$name: $d - set $values[6] $values[7] ($dayOfWeek, $values[0]-$values[1]-$values[2] $values[3]:$values[4]:$values[5])";
|
||||
CommandSet($hash, $values[6]." ".$values[7]) if ($values[7] ne "DEF");
|
||||
$state = "$d set $values[6] $values[7] accomplished";
|
||||
# $state = "$d set $values[6] $values[7] accomplished";
|
||||
readingsSingleUpdate($hash, "state" , "$d set $values[6] $values[7] accomplished", 1);
|
||||
if ($values[7] eq "DEF") {
|
||||
if (AttrVal($name, $d."_set", undef)) {
|
||||
Log3 $name, 5, "$name: $d - exec at command: ".AttrVal($name, $d."_set", undef);
|
||||
|
Loading…
Reference in New Issue
Block a user