Commit Diff


commit - ff92d109983c57fab444f0b3f759e58276659755
commit + 53808b4295d0dd5829a13c57d7718d92cc0d7467
blob - 3a892e793d7c9204fd00c55d6bb9f6e55f8973bd
blob + 6256f42999c8751d299c955f84a2a7493f43ddb1
--- huectl.pl
+++ huectl.pl
@@ -20,7 +20,7 @@ GetOptions(
 	"id=i" => \(my $RESOURCE_ID),
 	"sensor=i" => \(my $SENSOR_ID),
 	"battery=i" => \(my $BATTERY),
-	"heat" => \(my $HEAT),
+	"climate" => \(my $CLIMATE),
 	"action=s" => \(my $ACTION = "state"),
 	"verbose" => \(my $VERBOSE),
 	"debug" => \(my $DEBUG),
@@ -35,8 +35,8 @@ bridge-name    as defined in [HOME]./hue.conf or [HOME
 -i | --id      light-id
 -s | --sensor  sensor-id
 -b | --battery percent of battery level to report on, only relevant with sensors
+-c | --climate show temperature of sensors in C, only relevant with sensors
 -a | --action  [ on | off | state | bright | relax | morning | dimmed | evening | nightlight ] (default: state)
--h | --heat    show temperature of sensors in C, only relevant with sensors
 -v | --verbose  
 -d | --debug   JSON output
 -p | --pretty  pretty JSON output (can be a lot)
@@ -69,7 +69,7 @@ if (!$bridgename) { _return_error_with($USAGE); }
 
 my @config_files = map { -e $_ ? $_ : () } ('./hue.conf', './.hue.conf', '/etc/hue.conf', "$ENV{'HOME'}/.hue.conf", "$ENV{'HOME'}/hue.conf");
 my $config = Config::Tiny->read($config_files[-1], 'utf8');
-my $bridge = $config->{$bridgename}{ip} || _return_error_with("Error: bridge-name '$bridgename' not found.\n\n$USAGE");
+my $bridge = $config->{$bridgename}{ip} || _return_error_with("$USAGE\nError: bridge-name '$bridgename' not found.\n");
 my $token = $config->{$bridgename}{token};
 my $http = HTTP::Tiny->new;
 my $json = JSON::PP->new;
@@ -209,7 +209,7 @@ sub sensors {
 		}
 	}
 
-	if (! $BATTERY && ! $HEAT) {
+	if (! $BATTERY && ! $CLIMATE) {
 		printf "%4s %-34s %-8s %s (%s)\n", "ID", "Name", "State", "Type", $TYPE;
 		print "################################################################################\n";
 	}
@@ -222,7 +222,7 @@ sub sensors {
 					}
 				}	
 			}
-			elsif ($HEAT) {
+			elsif ($CLIMATE) {
 				if ($sensor_objects->{$key}->{'type'} =~ /ZLLPresence/) {
 					$name = $sensor_objects->{$key}->{'name'};
 				}