Skip to content

Commit

Permalink
Merge pull request #259 from krkeegan/Zero_State
Browse files Browse the repository at this point in the history
Allow for State of 0
  • Loading branch information
krkeegan committed Sep 27, 2013
2 parents f6e4030 + 428bf69 commit 86b5d72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Generic_Item.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ sub set_state_log {
$target = '' unless defined $target;
unshift(@{$$self{state_log}}, "$main::Time_Date $state set_by=$set_by_name"
. (($target)?"target=$target":''))
if $state or (ref $self) eq 'Voice_Cmd';
if defined($state) or (ref $self) eq 'Voice_Cmd';
pop @{$$self{state_log}} if $$self{state_log} and @{$$self{state_log}}
> $main::config_parms{max_state_log_entries};

Expand Down
4 changes: 2 additions & 2 deletions lib/http_server.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2381,7 +2381,7 @@ sub html_item_state {
my $filename = $object->{filename};
my $state_now = $object->{state};
my $html;
$state_now = '' unless $state_now; # Avoid -w uninitialized value msg
$state_now = '' unless defined($state_now); # Avoid -w uninitialized value msg

# If >2 possible states, add a Select pull down form
my @states;
Expand All @@ -2407,7 +2407,7 @@ sub html_item_state {
if (my $h_icon = &html_find_icon_image($object, $object_type)) {
$html .= qq[<img src="$h_icon" alt="$object_name" border="0"></a>];
}
elsif ($state_now) {
elsif ($state_now ne '') {
my $temp = $state_now;
$temp = substr($temp, 0, 8) . '..' if length $temp > 8;
$html .= $temp . '</a>&nbsp';
Expand Down

0 comments on commit 86b5d72

Please sign in to comment.