39_alexa.pm: include RoomListIntent and DeviceListIntent in get interactionModel

git-svn-id: https://svn.fhem.de/fhem/trunk@12769 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2016-12-14 00:08:16 +00:00
parent 57c66a8a91
commit 347a5c997d

View File

@ -289,6 +289,8 @@ Log 1, Dumper $characteristicsOfIntent;
$mapping->{verb} = [$mapping->{verb}] if( ref($mapping->{verb}) ne 'ARRAY' );
foreach my $verb (@{$mapping->{verb}}) {
$samples .= "\n" if( $samples );
my @articles = ('','{article}');
if( ref($mapping->{articles}) eq 'ARRAY' ) {
$articles[1] = "{${characteristic}_article}";
@ -327,8 +329,21 @@ Log 1, Dumper $characteristicsOfIntent;
++$i;
}
$samples .= "\n";
}
$samples .= "\n";
push @{$schema->{intents}}, {intent => "StatusIntent",
slots => [ { name => 'Device', type => 'FHEM_Device' },
{ name => 'Room', type => 'FHEM_Room' } ]};
push @{$schema->{intents}}, {intent => "RoomListIntent", };
push @{$schema->{intents}}, {intent => "DeviceListIntent",
slots => [ { name => 'Device', type => 'FHEM_Device' }, ]};
$samples .= "\nRoomListIntent raumliste";
$samples .= "\nDeviceListIntent geräteliste";
$samples .= "\nDeviceListIntent geräteliste {Room}";
$samples .= "\nDeviceListIntent geräteliste für {artikel} {Room}";
$samples .= "\n";
my $json = JSON->new;
$json->pretty(1);