2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

49_SSCamSTRM.pm: initial version

git-svn-id: https://svn.fhem.de/fhem/trunk@16844 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2018-06-10 15:01:16 +00:00
parent 36d4ed8193
commit 24525b51c2
2 changed files with 207 additions and 0 deletions

206
fhem/FHEM/49_SSCamSTRM.pm Normal file
View File

@ -0,0 +1,206 @@
########################################################################################################################
# $Id$
#########################################################################################################################
# 49_SSCamSTRM.pm
#
# (c) 2018 by Heiko Maaz
# e-mail: Heiko dot Maaz at t-online dot de
#
# This Module is used by module 49_SSCam to create Streaming devices.
# It can't be used to create standalone devices wihout any SSCam-Device
# The module is based on 98_weblink.pm of Rudolf König.
#
# This script is part of fhem.
#
# Fhem is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Fhem is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################################################################
# Versions History:
#
# 0.1 10.06.2018 initial Version
package main;
use strict;
use warnings;
use vars qw($FW_subdir); # Sub-path in URL for extensions, e.g. 95_FLOORPLAN
my $SSCamSTRMVersion = "0.1";
#####################################
sub SSCamSTRM_Initialize($) {
my ($hash) = @_;
$hash->{DefFn} = "SSCamSTRM_Define";
$hash->{AttrList} = "disable:0,1 htmlattr ";
$hash->{FW_summaryFn} = "SSCamSTRM_FwFn";
$hash->{FW_detailFn} = "SSCamSTRM_FwFn";
$hash->{FW_atPageEnd} = 1;
}
#####################################
sub SSCamSTRM_Define($$) {
my ($hash, $def) = @_;
my ($name, $type, $link) = split("[ \t]+", $def, 3);
if(!$link) {
return "Usage: define <name> SSCamSTRM <arg>";
}
my $arg = (split("[()]",$link))[1];
$arg =~ s/'//g;
($hash->{PARENT},$hash->{MODEL}) = ((split(",",$arg))[0],(split(",",$arg))[2]);
$hash->{VERSION} = $SSCamSTRMVersion;
$hash->{LINK} = $link;
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"state", "initialized"); # Init für "state"
readingsEndUpdate($hash,1);
return undef;
}
#####################################
# FLOORPLAN compat
sub FW_showSSCamSTRM($$$$) {
my ($d,undef,undef,$buttons) = @_;
if($buttons !~ m/HASH/) {
my %h = (); $buttons = \%h;
}
FW_pO(SSCamSTRM_FwFn(undef, $d, "", $buttons));
return $buttons;
}
##################
sub SSCamSTRM_FwDetail($@) {
my ($d, $text, $nobr)= @_;
return "" if(AttrVal($d, "group", ""));
my $alias = AttrVal($d, "alias", $d);
my $ret = ($nobr ? "" : "<br>");
$ret .= "$text " if($text);
$ret .= FW_pHPlain("detail=$d", $alias) if(!$FW_subdir);
$ret .= "<br>";
return $ret;
}
sub SSCamSTRM_FwFn($$$$) {
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
my $hash = $defs{$d};
my $link = $hash->{LINK};
my $ret = "";
return "" if(IsDisabled($d));
my $attr = AttrVal($d, "htmlattr", "");
$link = AnalyzePerlCommand(undef, $link) if($link =~ m/^{(.*)}$/s);
$ret = $link;
return $ret;
}
1;
=pod
=item summary define a Streaming device by SSCam module
=item summary_DE Erstellung eines Streaming-Device durch SSCam-Modul
=begin html
<a name="SSCamSTRM"></a>
<h3>SSCamSTRM</h3>
<ul>
<a name="SSCamSTRMdefine"></a>
<b>Define</b>
<ul>
A SSCam Streaming-device is defined by the SSCam "set &lt;name&gt; createStreamDev" command.
Please refer to SSCam <a href="#SSCamcreateStreamDev">"createStreamDev"</a> command.
<br><br>
</ul>
<a name="SSCamSTRMset"></a>
<b>Set</b> <ul>N/A</ul><br>
<a name="SSCamSTRMget"></a>
<b>Get</b> <ul>N/A</ul><br>
<a name="SSCamSTRMattr"></a>
<b>Attributes</b>
<ul>
<a name="htmlattr"></a>
<li>htmlattr - HTML attributes to be used for Streaming device e.g.:<br>
<ul>
<code>
attr &lt;name&gt; htmlattr width="480" height="560"<br>
</code>
</ul></li>
<li>disable - deactivates the device definition</li>
</ul>
<br>
</ul>
=end html
=begin html_DE
<a name="SSCamSTRM"></a>
<h3>SSCamSTRM</h3>
<ul>
<a name="SSCamSTRMdefine"></a>
<b>Define</b>
<ul>
Ein SSCam Streaming-Device wird durch den SSCam Befehl "set &lt;name&gt; createStreamDev" erstellt.
Siehe auch die Beschreibung zum SSCam <a href="#SSCamcreateStreamDev">"createStreamDev"</a> Befehl.
<br><br>
</ul>
<a name="SSCamSTRMset"></a>
<b>Set</b> <ul>N/A</ul><br>
<a name="SSCamSTRMget"></a>
<b>Get</b> <ul>N/A</ul><br>
<a name="SSCamSTRMattr"></a>
<b>Attributes</b>
<ul>
<a name="htmlattr"></a>
<li>htmlattr - HTML-Attribute zur Darstellungänderung des SSCam Streaming Device z.B.:<br>
<ul>
<code>
attr &lt;name&gt; htmlattr width="480" height="560"<br>
</code>
</ul></li>
<li>disable - aktiviert/deaktiviert das Device</li>
</ul>
<br>
</ul>
=end html_DE
=cut

View File

@ -240,6 +240,7 @@ FHEM/46_Aqicn.pm CoolTux Sonstige Systeme
FHEM/47_OBIS.pm icinger Sonstige Systeme
FHEM/49_IPCAM.pm mfr69bs Sonstiges
FHEM/49_SSCAM.pm DS_Starter Sonstiges
FHEM/49_SSCamSTRM.pm DS_Starter Sonstiges
FHEM/49_TBot_List.pm viegener Unterstuetzende Dienste
FHEM/50_HP1000.pm loredo Heizungssteuerung/Raumklima
FHEM/50_MOBILEALERTSGW.pm MarkusF Sonstige Systeme