change license reading
This commit is contained in:
parent
9c9e790d88
commit
9fddd33c83
@ -364,6 +364,7 @@ sub Weather_WriteReadings($$) {
|
||||
foreach my $r (keys %{$dataRef} ) {
|
||||
readingsBulkUpdate($hash, $r, $dataRef->{$r})
|
||||
if ( ref($dataRef->{$r}) ne 'HASH' and ref($dataRef->{$r}) ne 'ARRAY' );
|
||||
readingsBulkUpdate($hash, '.license', $dataRef->{license}->{text});
|
||||
}
|
||||
|
||||
readingsBulkUpdate($hash, "validity", "up-to-date");
|
||||
@ -485,12 +486,13 @@ sub Weather_Get($@) {
|
||||
my $value;
|
||||
|
||||
if(defined($hash->{READINGS}->{$reading})) {
|
||||
$value= $hash->{READINGS}->{$reading}->{VAL};
|
||||
$value = $hash->{READINGS}->{$reading}->{VAL};
|
||||
} else {
|
||||
my $rt= "";
|
||||
my $rt = '';
|
||||
if(defined($hash->{READINGS})) {
|
||||
$rt= join(":noArg ", sort keys %{$hash->{READINGS}});
|
||||
$rt = join(":noArg ", sort keys %{$hash->{READINGS}});
|
||||
}
|
||||
|
||||
return "Unknown reading $reading, choose one of " . $rt;
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ sub _ProcessingRetrieveData($$) {
|
||||
localtime( $self->{fetchTime} )
|
||||
);
|
||||
$self->{cached}->{timezone} = $data->{timezone};
|
||||
$self->{cached}->{license}->{Text} = $data->{flags}->{'meteoalarm-license'};
|
||||
$self->{cached}->{license}{text} = $data->{flags}->{'meteoalarm-license'};
|
||||
$self->{cached}->{current} = {
|
||||
'temperature' => int(
|
||||
sprintf( "%.1f", $data->{currently}->{temperature} ) + 0.5
|
||||
|
@ -250,6 +250,7 @@ sub _ProcessingRetrieveData($$) {
|
||||
if ( $self->{endpoint} eq 'weather' ) {
|
||||
$self->{cached}->{country} = $data->{sys}->{country};
|
||||
$self->{cached}->{city} = $data->{name};
|
||||
$self->{cached}->{license}{text} = 'none';
|
||||
$self->{cached}->{current} = {
|
||||
'temperature' => int(
|
||||
sprintf( "%.1f", ( $data->{main}->{temp} - 273.15 )
|
||||
|
Loading…
Reference in New Issue
Block a user