Support cover and switch
13
Changelog
Normal 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
|
||||||
BIN
HTML/EN/plugins/Assistant/html/images/cover_closed.png
Normal file
|
After Width: | Height: | Size: 848 B |
BIN
HTML/EN/plugins/Assistant/html/images/cover_opened.png
Normal file
|
After Width: | Height: | Size: 862 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
HTML/EN/plugins/Assistant/html/images/switch_off.png
Normal file
|
After Width: | Height: | Size: 909 B |
BIN
HTML/EN/plugins/Assistant/html/images/switch_on.png
Normal file
|
After Width: | Height: | Size: 915 B |
29
Plugin.pm
@@ -130,11 +130,11 @@ sub getItem {
|
|||||||
items => $gitems,
|
items => $gitems,
|
||||||
};
|
};
|
||||||
|
|
||||||
} elsif ($namespace eq 'light') {
|
} elsif ($namespace eq 'light' || $namespace eq 'switch') {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name => $entities{$id}->{'attributes'}->{'friendly_name'},
|
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'},
|
order => $entities{$id}->{'attributes'}->{'order'},
|
||||||
nextWindow => 'refresh',
|
nextWindow => 'refresh',
|
||||||
type => 'link',
|
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') {
|
} elsif ($namespace eq 'sensor') {
|
||||||
|
|
||||||
my $name = $entities{$id}->{'attributes'}->{'friendly_name'}.' '.$entities{$id}->{'state'}.$entities{$id}->{'attributes'}->{'unit_of_measurement'};
|
my $name = $entities{$id}->{'attributes'}->{'friendly_name'}.' '.$entities{$id}->{'state'}.$entities{$id}->{'attributes'}->{'unit_of_measurement'};
|
||||||
|
|||||||
@@ -16,5 +16,5 @@
|
|||||||
<minVersion>7.6</minVersion>
|
<minVersion>7.6</minVersion>
|
||||||
</targetApplication>
|
</targetApplication>
|
||||||
<type>2</type>
|
<type>2</type>
|
||||||
<version>0.5</version>
|
<version>0.6</version>
|
||||||
</extension>
|
</extension>
|
||||||
|
|||||||