fix change attribut model
This commit is contained in:
parent
61c39b23d5
commit
b00621193f
@ -131,12 +131,15 @@ sub Weather_DebugCodes($) {
|
|||||||
sub Weather_Initialize($) {
|
sub Weather_Initialize($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
$hash->{DefFn} = "Weather_Define";
|
$hash->{DefFn} = 'Weather_Define';
|
||||||
$hash->{UndefFn} = "Weather_Undef";
|
$hash->{UndefFn} = 'Weather_Undef';
|
||||||
$hash->{GetFn} = "Weather_Get";
|
$hash->{GetFn} = 'Weather_Get';
|
||||||
$hash->{SetFn} = "Weather_Set";
|
$hash->{SetFn} = 'Weather_Set';
|
||||||
$hash->{AttrList}= "disable:0,1 " . $readingFnAttributes;
|
$hash->{AttrList}=
|
||||||
$hash->{NotifyFn}= "Weather_Notify";
|
'disable:0,1 '
|
||||||
|
. 'model '
|
||||||
|
. $readingFnAttributes;
|
||||||
|
$hash->{NotifyFn}= 'Weather_Notify';
|
||||||
|
|
||||||
#Weather_DebugCodes('de');
|
#Weather_DebugCodes('de');
|
||||||
}
|
}
|
||||||
@ -432,13 +435,12 @@ sub Weather_Define($$) {
|
|||||||
$hash->{API} = $api;
|
$hash->{API} = $api;
|
||||||
$hash->{APIKEY} = $apikey;
|
$hash->{APIKEY} = $apikey;
|
||||||
$hash->{APIOPTIONS} = $apioptions;
|
$hash->{APIOPTIONS} = $apioptions;
|
||||||
$attr{$name}->{model} = $api;
|
|
||||||
#$hash->{UNITS} = "c"; # hardcoded to use degrees centigrade (Celsius)
|
|
||||||
$hash->{READINGS}->{current_date_time}->{TIME}= TimeNow();
|
$hash->{READINGS}->{current_date_time}->{TIME}= TimeNow();
|
||||||
$hash->{READINGS}->{current_date_time}->{VAL}= "none";
|
$hash->{READINGS}->{current_date_time}->{VAL}= "none";
|
||||||
|
|
||||||
$hash->{fhem}->{allowCache}= 1;
|
$hash->{fhem}->{allowCache}= 1;
|
||||||
|
|
||||||
|
CommandAttr(undef,$name . ' model ' . $api) if ( AttrVal($name,'model','none') ne $api );
|
||||||
|
|
||||||
readingsSingleUpdate($hash,'state','Initialized',1);
|
readingsSingleUpdate($hash,'state','Initialized',1);
|
||||||
Weather_LanguageInitialize($hash->{LANG});
|
Weather_LanguageInitialize($hash->{LANG});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user