Support cover and switch

This commit is contained in:
Hans Karlinius
2017-06-03 10:52:37 +02:00
parent 4ec993e3ca
commit 1a539cd15a
11 changed files with 41 additions and 3 deletions

13
Changelog Normal file
View File

@@ -0,0 +1,13 @@
#### Version 0.6
##### Added
- Support for switch
- Support for cover open/close
#### Version 0.5
##### Added
- Group status pics
##### Changed
- From toggle light to on/off
- New pics
##### Fixed
- Menu ordering

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

View File

@@ -130,11 +130,11 @@ sub getItem {
items => $gitems,
};
} elsif ($namespace eq 'light') {
} elsif ($namespace eq 'light' || $namespace eq 'switch') {
return {
name => $entities{$id}->{'attributes'}->{'friendly_name'},
image => 'plugins/Assistant/html/images/light_'.$entities{$id}->{'state'}.'.png',
image => 'plugins/Assistant/html/images/'.$namespace.'_'.$entities{$id}->{'state'}.'.png',
order => $entities{$id}->{'attributes'}->{'order'},
nextWindow => 'refresh',
type => 'link',
@@ -148,6 +148,31 @@ sub getItem {
],
};
} elsif ($namespace eq 'cover') {
my $service = 'stop_cover';
if ($entities{$id}->{'state'} eq 'closed') {
$service = 'open_cover';
} elsif ($entities{$id}->{'state'} eq 'open') {
$service = 'close_cover';
}
return {
name => $entities{$id}->{'attributes'}->{'friendly_name'},
image => 'plugins/Assistant/html/images/'.$namespace.'_'.$entities{$id}->{'state'}.'.png',
order => $entities{$id}->{'attributes'}->{'order'},
nextWindow => 'refresh',
type => 'link',
url => \&servicesCall,
passthrough => [
{
entity_id => $entities{$id}->{'entity_id'},
domain => $namespace,
service => $service,
}
],
};
} elsif ($namespace eq 'sensor') {
my $name = $entities{$id}->{'attributes'}->{'friendly_name'}.' '.$entities{$id}->{'state'}.$entities{$id}->{'attributes'}->{'unit_of_measurement'};

View File

@@ -16,5 +16,5 @@
<minVersion>7.6</minVersion>
</targetApplication>
<type>2</type>
<version>0.5</version>
<version>0.6</version>
</extension>