39_gassistant: create GoogleAssistant room and dummy device on define
git-svn-id: https://svn.fhem.de/fhem/trunk@19694 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -77,6 +77,14 @@ gassistant_Define($$)
|
|||||||
my $name = $a[0];
|
my $name = $a[0];
|
||||||
$hash->{NAME} = $name;
|
$hash->{NAME} = $name;
|
||||||
|
|
||||||
|
if( !defined( $attr{$hash->{NAME}}{room} ) ) {
|
||||||
|
$attr{$hash->{NAME}}{room} = "GoogleAssistant";
|
||||||
|
#create dummy on/off device
|
||||||
|
CommandDefine(undef, "GoogleAssistant_dummy dummy");
|
||||||
|
CommandAttr(undef, "GoogleAssistant_dummy alias Testlight");
|
||||||
|
CommandAttr(undef, "GoogleAssistant_dummy setList on off");
|
||||||
|
CommandAttr(undef, "GoogleAssistant_dummy room GoogleAssistant");
|
||||||
|
}
|
||||||
|
|
||||||
my $d = $modules{$hash->{TYPE}}{defptr};
|
my $d = $modules{$hash->{TYPE}}{defptr};
|
||||||
return "$hash->{TYPE} device already defined as $d->{NAME}." if( defined($d) && $name ne $d->{NAME} );
|
return "$hash->{TYPE} device already defined as $d->{NAME}." if( defined($d) && $name ne $d->{NAME} );
|
||||||
@@ -365,6 +373,7 @@ gassistant_configDefault($;$)
|
|||||||
Log3 $name, 2, "$name: created default configfile: $configfile";
|
Log3 $name, 2, "$name: created default configfile: $configfile";
|
||||||
|
|
||||||
CommandAttr(undef, "$name gassistantFHEM-config $configfile") if( !AttrVal($name, 'gassistantFHEM-config', undef ) );
|
CommandAttr(undef, "$name gassistantFHEM-config $configfile") if( !AttrVal($name, 'gassistantFHEM-config', undef ) );
|
||||||
|
CommandAttr(undef, "$name nrarchive 10") if( !AttrVal($name, 'nrarchive', undef ) );
|
||||||
|
|
||||||
CommandSave(undef,undef) if( AttrVal( "autocreate", "autosave", 1 ) );
|
CommandSave(undef,undef) if( AttrVal( "autocreate", "autosave", 1 ) );
|
||||||
|
|
||||||
@@ -745,17 +754,15 @@ gassistant_Attr($$$)
|
|||||||
<b>Set</b>
|
<b>Set</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li>reload<br>
|
<li>reload<br>
|
||||||
Reloads the device <code>name</code> or all devices in gassistant-fhem.
|
Reloads the devices and sends them to Google.
|
||||||
Will try to send a proacive event to amazon. If this succedes no manual device discovery is needed.
|
</li>
|
||||||
If this fails you have to you have to manually start a device discovery
|
|
||||||
for the home automation skill in the amazon gassistant app.</li>
|
|
||||||
|
|
||||||
<li>createDefaultConfig<br>
|
<li>createDefaultConfig<br>
|
||||||
adds the default config for the sshproxy to the existing config file or creates a new config file. sets the
|
creates a default gassistant-fhem.cfg file
|
||||||
gassistantFHEM-config attribut if not already set.</li>
|
gassistantFHEM-config attribut if not already set.</li>
|
||||||
|
|
||||||
<li>clearCredentials<br>
|
<li>clearCredentials<br>
|
||||||
clears all stored sshproxy credentials</li>
|
clears all stored credentials</li>
|
||||||
|
|
||||||
<li>unregister<br>
|
<li>unregister<br>
|
||||||
unregister and delete all data in FHEM Connect</li>
|
unregister and delete all data in FHEM Connect</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user