Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for State of 0 #259

Merged
merged 1 commit into from
Sep 27, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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