2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

59_Wunderground: fix regex for PWS

git-svn-id: https://svn.fhem.de/fhem/trunk@13508 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2017-02-25 11:55:10 +00:00
parent 6b300e0c5a
commit 2522c2d3d2

View File

@ -279,6 +279,7 @@ sub Wunderground_GetStatus($;$) {
$features .= "/lang:" . $hash->{LANG};
$features .= "/pws:$pws" if ( defined($pws) );
$features .= "/bestfct:$bestfct" if ( defined($bestfct) );
$hash->{FEATURES} = $features;
Wunderground_SendCommand( $hash, $features );
@ -340,7 +341,7 @@ sub Wunderground_Define($$$) {
$hash->{QUERY} = @$a[3];
$hash->{QUERY} = "pws:" . $hash->{QUERY}
if ( $hash->{QUERY} =~ /^[A-Z]{3,}\d{2,}$/ );
if ( $hash->{QUERY} =~ /^[A-Z]{3,}\d{1,}$/ );
if ( $init_done && !defined( $hash->{OLDDEF} ) ) {
fhem 'attr ' . $name . ' stateReadings temp_c humidity';
@ -404,8 +405,11 @@ sub Wunderground_SendCommand($$) {
timeout => AttrVal( $name, "timeout", "3" ),
hash => $hash,
method => "GET",
header =>
"agent: FHEM-Wunderground/1.0.0\r\nUser-Agent: FHEM-Wunderground/1.0.0\r\nAccept: application/json",
header => {
agent => 'FHEM-Wunderground/1.0.0',
'User-Agent' => 'FHEM-Wunderground/1.0.0',
Accept => 'application/json',
},
httpversion => "1.1",
callback => \&Wunderground_ReceiveCommand,
}
@ -1027,7 +1031,8 @@ sub Wunderground_Undefine($$$) {
Example:
<ul><br>
<code>
define WUweather Wunderground d123ab11bb2c3456 IBAYERNM70<br>
define WUweather Wunderground d123ab11bb2c3456 EDDF<br>
define WUweather Wunderground d123ab11bb2c3456 pws:IBAYERNM70<br>
define WUweather Wunderground d123ab11bb2c3456 Germany/Berlin<br>
</code><br>
</ul>