From 24525b51c210ac578b3dcbbfa14c5bc51b695d97 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sun, 10 Jun 2018 15:01:16 +0000 Subject: [PATCH] 49_SSCamSTRM.pm: initial version git-svn-id: https://svn.fhem.de/fhem/trunk@16844 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/49_SSCamSTRM.pm | 206 ++++++++++++++++++++++++++++++++++++++ fhem/MAINTAINER.txt | 1 + 2 files changed, 207 insertions(+) create mode 100644 fhem/FHEM/49_SSCamSTRM.pm diff --git a/fhem/FHEM/49_SSCamSTRM.pm b/fhem/FHEM/49_SSCamSTRM.pm new file mode 100644 index 000000000..232ac811c --- /dev/null +++ b/fhem/FHEM/49_SSCamSTRM.pm @@ -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 . +# +######################################################################################################################### +# 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 SSCamSTRM "; + } + + 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 ? "" : "
"); + $ret .= "$text " if($text); + $ret .= FW_pHPlain("detail=$d", $alias) if(!$FW_subdir); + $ret .= "
"; + +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 + + +

SSCamSTRM

+ +
    + + Define + +
      + A SSCam Streaming-device is defined by the SSCam "set <name> createStreamDev" command. + Please refer to SSCam "createStreamDev" command. +

      +
    + + + Set
      N/A

    + + + Get
      N/A

    + + + Attributes + +
      + +
    • htmlattr - HTML attributes to be used for Streaming device e.g.:
      +
        + + attr <name> htmlattr width="480" height="560"
        +
        +
    • + +
    • disable - deactivates the device definition
    • +
    +
    + +
+ +=end html +=begin html_DE + + +

SSCamSTRM

+ +
    + + Define + +
      + Ein SSCam Streaming-Device wird durch den SSCam Befehl "set <name> createStreamDev" erstellt. + Siehe auch die Beschreibung zum SSCam "createStreamDev" Befehl. +

      +
    + + + Set
      N/A

    + + + Get
      N/A

    + + + Attributes + +
      + +
    • htmlattr - HTML-Attribute zur Darstellungänderung des SSCam Streaming Device z.B.:
      +
        + + attr <name> htmlattr width="480" height="560"
        +
        +
    • + +
    • disable - aktiviert/deaktiviert das Device
    • +
    +
    + +
+ +=end html_DE +=cut diff --git a/fhem/MAINTAINER.txt b/fhem/MAINTAINER.txt index 833b9ee48..6104daf9d 100644 --- a/fhem/MAINTAINER.txt +++ b/fhem/MAINTAINER.txt @@ -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