mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
70_KODI: added attribute pvrEnabled for disabling PVR support to avoid error messages
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20490 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f7a11961ad
commit
2bb8a83206
@ -114,7 +114,7 @@ sub KODI_Initialize($$)
|
|||||||
$hash->{ReadyFn} = "KODI_Ready";
|
$hash->{ReadyFn} = "KODI_Ready";
|
||||||
$hash->{UndefFn} = "KODI_Undefine";
|
$hash->{UndefFn} = "KODI_Undefine";
|
||||||
$hash->{AttrFn} = "KODI_Attr";
|
$hash->{AttrFn} = "KODI_Attr";
|
||||||
$hash->{AttrList} = "compatibilityMode:kodi,plex offMode:quit,hibernate,shutdown,suspend updateInterval disable:0,1 jsonResponseReading:0,1 " . $readingFnAttributes;
|
$hash->{AttrList} = "compatibilityMode:kodi,plex offMode:quit,hibernate,shutdown,suspend updateInterval disable:0,1 jsonResponseReading:0,1 pvrEnabled:0,1 " . $readingFnAttributes;
|
||||||
|
|
||||||
$data{RC_makenotify}{XBMC} = "KODI_RCmakenotify";
|
$data{RC_makenotify}{XBMC} = "KODI_RCmakenotify";
|
||||||
$data{RC_layout}{KODI_RClayout} = "KODI_RClayout";
|
$data{RC_layout}{KODI_RClayout} = "KODI_RClayout";
|
||||||
@ -1476,20 +1476,51 @@ sub KODI_PlayerCommand($$$)
|
|||||||
return KODI_Call($hash,$req,1);
|
return KODI_Call($hash,$req,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub KODI_IsPvrEnabled($)
|
||||||
|
{
|
||||||
|
my ($hash) = @_;
|
||||||
|
return AttrVal($hash->{NAME}, 'pvrEnabled', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub KODI_PvrGetProperties($)
|
||||||
|
{
|
||||||
|
my ($hash) = @_;
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
Log3($name, 4, "$name: KODI_PvrGetProperties");
|
||||||
|
|
||||||
|
return undef if not KODI_IsPvrEnabled($hash);
|
||||||
|
|
||||||
|
my $obj = {
|
||||||
|
"method" => "PVR.GetProperties",
|
||||||
|
"params" => {
|
||||||
|
"properties" => ["available","recording","scanning"]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return KODI_Call($hash,$obj,1);
|
||||||
|
}
|
||||||
|
|
||||||
sub KODI_PvrUpdateChannels($)
|
sub KODI_PvrUpdateChannels($)
|
||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
|
return undef if not KODI_IsPvrEnabled($hash);
|
||||||
|
|
||||||
|
|
||||||
fhem("deletereading $hash->{NAME} channel_.*", 1);
|
fhem("deletereading $hash->{NAME} channel_.*", 1);
|
||||||
fhem("deletereading $hash->{NAME} channelgroup_.*", 1);
|
fhem("deletereading $hash->{NAME} channelgroup_.*", 1);
|
||||||
|
|
||||||
KODI_PvrGetChannelGroups($hash, "tv");
|
KODI_PvrGetChannelGroups($hash, "tv");
|
||||||
KODI_PvrGetChannelGroups($hash, "radio");
|
KODI_PvrGetChannelGroups($hash, "radio");
|
||||||
|
|
||||||
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub KODI_PvrGetChannelGroups($$)
|
sub KODI_PvrGetChannelGroups($$)
|
||||||
{
|
{
|
||||||
my ($hash,$type) = @_;
|
my ($hash,$type) = @_;
|
||||||
|
|
||||||
|
return undef if not KODI_IsPvrEnabled($hash);
|
||||||
|
|
||||||
my $id = KODI_CreateId($hash);
|
my $id = KODI_CreateId($hash);
|
||||||
my $req = {
|
my $req = {
|
||||||
'method' => 'PVR.GetChannelGroups',
|
'method' => 'PVR.GetChannelGroups',
|
||||||
@ -1503,6 +1534,8 @@ sub KODI_PvrGetChannels($$)
|
|||||||
{
|
{
|
||||||
my ($hash,$channelGroupId) = @_;
|
my ($hash,$channelGroupId) = @_;
|
||||||
|
|
||||||
|
return undef if not KODI_IsPvrEnabled($hash);
|
||||||
|
|
||||||
my $id = KODI_CreateId($hash);
|
my $id = KODI_CreateId($hash);
|
||||||
my $req = {
|
my $req = {
|
||||||
'method' => 'PVR.GetChannels',
|
'method' => 'PVR.GetChannels',
|
||||||
@ -1956,6 +1989,8 @@ sub KODI_HTTP_Request($$@)
|
|||||||
<li>jsonResponseReading<br/>
|
<li>jsonResponseReading<br/>
|
||||||
When enabled then every received JSON message from Kodi will be saved into the reading <i>jsonResponse</i> so the last received message is always available.
|
When enabled then every received JSON message from Kodi will be saved into the reading <i>jsonResponse</i> so the last received message is always available.
|
||||||
Also an event is triggered upon each update.</li>
|
Also an event is triggered upon each update.</li>
|
||||||
|
<li>pvrEnabled<br/>
|
||||||
|
Defaults to 1. Disable to indicate that PVR is not available on your Kodi device. Basically meant to avoid error messages when trying to access PVR functions.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user