2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 14:47:00 +00:00

88_Timer: fixed PERL WARNING: Use of uninitialized value

git-svn-id: https://svn.fhem.de/fhem/trunk@20729 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
HomeAuto_User 2019-12-13 15:58:26 +00:00
parent 57668b2a78
commit 3ce0fa3da7
2 changed files with 10 additions and 9 deletions

View File

@ -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 PERL WARNING: Use of uninitialized value
- bugfix: 73_AutoShuttersControl: fix SelfDefense drive up then coming home
up at night
- feature: 30_HUEBridge, 31_HUEDevice: added deCONZ scenes (by shadowghost)

View File

@ -571,7 +571,7 @@ sub Timer_FW_Detail($$$$) {
for(my $spalte = 1; $spalte <= $cnt_max; $spalte++) {
$style_code1 .= "Padding-bottom:5px; " if ($zeile == $Timers_Count - 1); # letzte Zeile
$html.= "<td align=\"center\" style=\"$style_code1\">".sprintf("%02s", $timer_nr[$zeile])."</td>" if ($spalte == 1); # Spalte Timer-Nummer
if ($spalte >=2 && $spalte <= 7) { ## DropDown-Listen fuer Jahr, Monat, Tag, Stunde, Minute, Sekunde
if ($spalte >=2 && $spalte <= 7) { ## DropDown-Listen fuer Jahr, Monat, Tag, Stunde, Minute, Sekunde
my $start = 0; # Stunde, Minute, Sekunde
my $stop = 12; # Monat
my $step = 1; # Jahr, Monat, Tag, Stunde, Minute
@ -601,7 +601,7 @@ sub Timer_FW_Detail($$$$) {
$html.="</select></td>";
}
if ($spalte == 8) { ## Spalte Geraete
if ($spalte == 8) { ## Spalte Geraete
$id ++;
my $comment = "";
$comment = AttrVal($select_Value[$spalte-2],"alias","") if (AttrVal($name,"Show_DeviceInfo","") eq "alias");
@ -609,7 +609,7 @@ sub Timer_FW_Detail($$$$) {
$html.= "<td align=\"center\" style=\"$style_code1\"><input size=\"$Table_Size_TextBox\" type=\"text\" placeholder=\"Timer_".($zeile + 1)."\" id=\"".$id."\" value=\"".$select_Value[$spalte-2]."\"><br><small>$comment</small></td>";
}
if ($spalte == 9) { ## DropDown-Liste Aktion
if ($spalte == 9) { ## DropDown-Liste Aktion
$id ++;
$html.= "<td align=\"center\" style=\"$style_code1\"><select id=\"".$id."\">"; # id need for java script
foreach (@action) {
@ -619,21 +619,21 @@ sub Timer_FW_Detail($$$$) {
$html.="</select></td>";
}
if ($spalte > 9 && $spalte < $cnt_max) { ## Spalte Wochentage + aktiv
if ($spalte > 9 && $spalte < $cnt_max) { ## Spalte Wochentage + aktiv
$id ++;
$html.= "<td align=\"center\" style=\"$style_code1\"><input type=\"checkbox\" name=\"days\" id=\"".$id."\" value=\"0\" onclick=\"Checkbox(".$id.")\"></td>" if ($select_Value[$spalte-2] eq "0");
$html.= "<td align=\"center\" style=\"$style_code1\"><input type=\"checkbox\" name=\"days\" id=\"".$id."\" value=\"1\" onclick=\"Checkbox(".$id.")\" checked></td>" if ($select_Value[$spalte-2] eq "1");
}
if ($spalte == $cnt_max) { ## Button Speichern
if ($spalte == $cnt_max) { ## Button Speichern
$id ++;
$html.= "<td align=\"center\" style=\"$style_code1 Padding-right:5px\"> <INPUT type=\"reset\" onclick=\"pushed_savebutton(".$id.")\" value=\"&#128190;\"/></td>"; # &#128427; &#128190;
}
Log3 $name, 5, "$name: attr2html | Timer=".$timer_nr[$zeile]." ".$names[$spalte-1]."=".$select_Value[$spalte-2]." cnt_max=$cnt_max ($spalte)" if ($spalte > 1 && $spalte < $cnt_max);
}
$html.= "</tr>"; ## Zeilenende
$html.= "</tr>"; ## Zeilenende
}
$html.= "</table>"; ## Tabellenende
$html.= "</table>"; ## Tabellenende
## Tabellenende + Script
$html.= '</div>
@ -760,8 +760,8 @@ sub FW_pushed_savebutton {
}
}
return "ERROR: The time is in the past. Please set a time in the future!" if ((time() - fhemTimeLocal($sec, $min, $hour, $mday, $month, $year)) > 0);
return "ERROR: The next switching point is too small!" if ((fhemTimeLocal($sec, $min, $hour, $mday, $month, $year) - time()) < 60);
return "ERROR: The time is in the past. Please set a time in the future!" if ((time() - fhemTimeLocal($sec, $min, $hour, $mday, $month - 1, $year)) > 0);
return "ERROR: The next switching point is too small!" if ((fhemTimeLocal($sec, $min, $hour, $mday, $month - 1, $year) - time()) < 60);
readingsDelete($hash,"Timer_".sprintf("%02s", $timer)."_set") if ($selected_buttons[8] ne "DEF" && ReadingsVal($name, "Timer_".sprintf("%02s", $timer)."_set", 0) ne "0");