Hauptmenü

KodiNowPlaying

Begonnen von eisi, 15 Oktober 2017, 20:14:41

Vorheriges Thema - Nächstes Thema

eisi

So funktioniert es jetzt bei mir:

var widget_kodinowplaying = $.extend({}, {
    widgetname:"kodinowplaying",
    init: function () {
        var base=this;
        this.elements = $('div[data-type="'+this.widgetname+'"]');
        this.elements.each(function(index) {
            if($(this).hasClass('titleonly')){
                $(this).attr('data-show', 'no');
                $(this).attr('data-season', 'no');
                $(this).attr('data-episode', 'no');
                $(this).attr('data-title', 'yes');
                $(this).attr('data-artist', 'no');
                $(this).attr('data-album', 'no');
                $(this).attr('data-time', 'no');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'no');
            } else if($(this).hasClass('short')){
                $(this).attr('data-show', 'yes');
                $(this).attr('data-season', 'no');
                $(this).attr('data-episode', 'no');
                $(this).attr('data-title', 'yes');
                $(this).attr('data-artist', 'no');
                $(this).attr('data-album', 'no');
                $(this).attr('data-time', 'yes');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'no');
            } else if($(this).hasClass('notime')){
                $(this).attr('data-show', 'yes');
                $(this).attr('data-season', 'yes');
                $(this).attr('data-episode', 'yes');
                $(this).attr('data-title', 'yes');
                $(this).attr('data-artist', 'yes');
                $(this).attr('data-album', 'yes');
                $(this).attr('data-time', 'no');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'yes');
            }

            // readings for KODI devices
            $(this).data('type', 'type');
            readings['type'] = true;

            if(!$(this).attr('data-show') || $(this).attr('data-show')=='yes') {
                $(this).data('currentShowtitle', 'currentShowtitle');
                readings['currentShowtitle'] = true;
            }
            if(!$(this).attr('data-season') || $(this).attr('data-season')=='yes') {
                $(this).data('season', 'season');
                readings['season'] = true;
            }
            if(!$(this).attr('data-episode') || $(this).attr('data-episode')=='yes') {
                $(this).data('episode', 'episode');
                readings['episode'] = true;
            }
            if(!$(this).attr('data-title') || $(this).attr('data-title')=='yes') {
                $(this).data('currentTitle', 'currentTitle');
                readings['currentTitle'] = true;
            }
            if(!$(this).attr('data-artist') || $(this).attr('data-artist')=='yes') {
                $(this).data('currentArtist', 'currentArtist');
                readings['currentArtist'] = true;
            }
            if(!$(this).attr('data-album') || $(this).attr('data-album')=='yes') {
                $(this).data('currentAlbum', 'currentAlbum');
                readings['currentAlbum'] = true;
            }
            if(!$(this).attr('data-time') || $(this).attr('data-time')=='yes') {
                $(this).data('time', 'time');
                readings['time'] = true;
            }
            if(!$(this).attr('data-totaltime') || $(this).attr('data-totaltime')=='yes') {
                $(this).data('totaltime', 'totaltime');
                readings['totaltime'] = true;
            }
            if(!$(this).attr('data-playstatus') || $(this).attr('data-playstatus')=='yes') {
                $(this).data('playStatus', 'playStatus');
                readings['playStatus'] = true;
            }
        });
    },

    update: function (dev,par) {
        var deviceElements= this.elements.filter('div[data-device="'+dev+'"]');
        deviceElements.each(function(index) {
            var type        = getDeviceValue($(this), 'type');
            var show        = getDeviceValue($(this), 'currentShowtitle');
            var season      = getDeviceValue($(this), 'season');
            var episode     = getDeviceValue($(this), 'episode');
            var title       = getDeviceValue($(this), 'currentTitle');
            var artist      = getDeviceValue($(this), 'currentArtist');
            var album       = getDeviceValue($(this), 'currentAlbum');
            var time        = getDeviceValue($(this), 'time');
            var totaltime   = getDeviceValue($(this), 'totaltime');
            var playStatus  = getDeviceValue($(this), 'playStatus');

            // check dateformat and substitute accordingly
            var dateformat = $(this).attr('data-timeformat');
            if(!dateformat) {
                switch(type) {
                    case "song": dateformat = 'MM:SS'; break;
                    default: dateformat = 'HH:MM:SS'; break;
                }
            }
            var subst = '';
            if(dateformat) {
                switch(dateformat.toUpperCase()) {
                    case "HH":          subst = '$1'; break;
                    case "HH:MM":       subst = '$1:$2'; break;
                    default:
                    case "HH:MM:SS":    subst = '$1:$2:$3'; break;
                    case "MM:SS":       subst = '$2:$3'; break;
                    case "SS":          subst = '$3'; break;
                }
            }
            if(subst) {
                if(time) {
                    time = time.replace(/^(\d\d):(\d\d):(\d\d).(.*)/, subst);
                }
                if(totaltime) {
                    totaltime = totaltime.replace(/^(\d\d):(\d\d):(\d\d).(.*)/, subst);
                }
            }

            // getDeviceValue might return a timestamp which is the readings updatetime
            // this is a bug in requestFhem not yet solved
            // check values which most likely would not contain a timestamp and empty them
            if(show && show.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                show='';
            }
            if(season && season.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                season='';
            }
            if(episode && episode.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                episode='';
            }
            if(title && title.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                title='';
            }
            if(artist && artist.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                artist='';
            }
            if(album && album.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                album='';
            }

            $(this).empty();
            $(this).html(
                  (show                 ? ' <span class="'+$(this).data('class-show')       +'">'   +show+'</span> '                                    :'')
                + (show && !season&&!episode ? ' - ' :'')
                + (season               ? ' <span class="'+$(this).data('class-season')     +'">S'  +(season.match(/^\d\d/)?'':'0')+season+'</span>'    :'')
                + (episode              ?  '<span class="'+$(this).data('class-episode')    +'">E'  +(episode.match(/^\d\d/)?'':'0')+episode+'</span> ' :'')
                + (artist               ? ' <span class="'+$(this).data('class-artist')     +'">'   +artist+' - </span>'                                :'')
                + (album                ? ' <span class="'+$(this).data('class-album')      +'">'   +album+' - </span>'                                 :'')
                + (title                ? ' <span class="'+$(this).data('class-title')      +'">'   +title+ '</span> '                                  :'')
                + (time || totaltime    ? ' [ ' : '')
                + (time                 ?  '<span class="'+$(this).data('class-time')       +'">'   +time+'</span>'                                     :'')
                + (time && totaltime    ?  ' / ' : '')
                + (totaltime            ?  '<span class="'+$(this).data('class-totaltime')  +'">'   +totaltime+'</span>'                                :'')
                + (time || totaltime    ? ' ] ' : '')
                + (playStatus && playStatus!="playing"? ' <span class="'+$(this).data('class-playstatus') +'">(' +playStatus+')</span> '                :'')
            );
        });
    }
});
3 x Rasp mit fhem 5.8 | 1 Rasp mit Kodi |1x Cube | 15 x MaxLan Thermostate und 18 Fensterschalter | 30 WLAN Schalter Sonoff | Diverse Sensoren mit Arduino | Tablet mit FTUI 2.6

masterpete23

Zitat von: eisi am 17 November 2017, 17:59:47
So funktioniert es jetzt bei mir:

var widget_kodinowplaying = $.extend({}, {
    widgetname:"kodinowplaying",
    init: function () {
        var base=this;
        this.elements = $('div[data-type="'+this.widgetname+'"]');
        this.elements.each(function(index) {
            if($(this).hasClass('titleonly')){
                $(this).attr('data-show', 'no');
                $(this).attr('data-season', 'no');
                $(this).attr('data-episode', 'no');
                $(this).attr('data-title', 'yes');
                $(this).attr('data-artist', 'no');
                $(this).attr('data-album', 'no');
                $(this).attr('data-time', 'no');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'no');
            } else if($(this).hasClass('short')){
                $(this).attr('data-show', 'yes');
                $(this).attr('data-season', 'no');
                $(this).attr('data-episode', 'no');
                $(this).attr('data-title', 'yes');
                $(this).attr('data-artist', 'no');
                $(this).attr('data-album', 'no');
                $(this).attr('data-time', 'yes');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'no');
            } else if($(this).hasClass('notime')){
                $(this).attr('data-show', 'yes');
                $(this).attr('data-season', 'yes');
                $(this).attr('data-episode', 'yes');
                $(this).attr('data-title', 'yes');
                $(this).attr('data-artist', 'yes');
                $(this).attr('data-album', 'yes');
                $(this).attr('data-time', 'no');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'yes');
            }

            // readings for KODI devices
            $(this).data('type', 'type');
            readings['type'] = true;

            if(!$(this).attr('data-show') || $(this).attr('data-show')=='yes') {
                $(this).data('currentShowtitle', 'currentShowtitle');
                readings['currentShowtitle'] = true;
            }
            if(!$(this).attr('data-season') || $(this).attr('data-season')=='yes') {
                $(this).data('season', 'season');
                readings['season'] = true;
            }
            if(!$(this).attr('data-episode') || $(this).attr('data-episode')=='yes') {
                $(this).data('episode', 'episode');
                readings['episode'] = true;
            }
            if(!$(this).attr('data-title') || $(this).attr('data-title')=='yes') {
                $(this).data('currentTitle', 'currentTitle');
                readings['currentTitle'] = true;
            }
            if(!$(this).attr('data-artist') || $(this).attr('data-artist')=='yes') {
                $(this).data('currentArtist', 'currentArtist');
                readings['currentArtist'] = true;
            }
            if(!$(this).attr('data-album') || $(this).attr('data-album')=='yes') {
                $(this).data('currentAlbum', 'currentAlbum');
                readings['currentAlbum'] = true;
            }
            if(!$(this).attr('data-time') || $(this).attr('data-time')=='yes') {
                $(this).data('time', 'time');
                readings['time'] = true;
            }
            if(!$(this).attr('data-totaltime') || $(this).attr('data-totaltime')=='yes') {
                $(this).data('totaltime', 'totaltime');
                readings['totaltime'] = true;
            }
            if(!$(this).attr('data-playstatus') || $(this).attr('data-playstatus')=='yes') {
                $(this).data('playStatus', 'playStatus');
                readings['playStatus'] = true;
            }
        });
    },

    update: function (dev,par) {
        var deviceElements= this.elements.filter('div[data-device="'+dev+'"]');
        deviceElements.each(function(index) {
            var type        = getDeviceValue($(this), 'type');
            var show        = getDeviceValue($(this), 'currentShowtitle');
            var season      = getDeviceValue($(this), 'season');
            var episode     = getDeviceValue($(this), 'episode');
            var title       = getDeviceValue($(this), 'currentTitle');
            var artist      = getDeviceValue($(this), 'currentArtist');
            var album       = getDeviceValue($(this), 'currentAlbum');
            var time        = getDeviceValue($(this), 'time');
            var totaltime   = getDeviceValue($(this), 'totaltime');
            var playStatus  = getDeviceValue($(this), 'playStatus');

            // check dateformat and substitute accordingly
            var dateformat = $(this).attr('data-timeformat');
            if(!dateformat) {
                switch(type) {
                    case "song": dateformat = 'MM:SS'; break;
                    default: dateformat = 'HH:MM:SS'; break;
                }
            }
            var subst = '';
            if(dateformat) {
                switch(dateformat.toUpperCase()) {
                    case "HH":          subst = '$1'; break;
                    case "HH:MM":       subst = '$1:$2'; break;
                    default:
                    case "HH:MM:SS":    subst = '$1:$2:$3'; break;
                    case "MM:SS":       subst = '$2:$3'; break;
                    case "SS":          subst = '$3'; break;
                }
            }
            if(subst) {
                if(time) {
                    time = time.replace(/^(\d\d):(\d\d):(\d\d).(.*)/, subst);
                }
                if(totaltime) {
                    totaltime = totaltime.replace(/^(\d\d):(\d\d):(\d\d).(.*)/, subst);
                }
            }

            // getDeviceValue might return a timestamp which is the readings updatetime
            // this is a bug in requestFhem not yet solved
            // check values which most likely would not contain a timestamp and empty them
            if(show && show.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                show='';
            }
            if(season && season.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                season='';
            }
            if(episode && episode.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                episode='';
            }
            if(title && title.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                title='';
            }
            if(artist && artist.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                artist='';
            }
            if(album && album.match(/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/)) {
                album='';
            }

            $(this).empty();
            $(this).html(
                  (show                 ? ' <span class="'+$(this).data('class-show')       +'">'   +show+'</span> '                                    :'')
                + (show && !season&&!episode ? ' - ' :'')
                + (season               ? ' <span class="'+$(this).data('class-season')     +'">S'  +(season.match(/^\d\d/)?'':'0')+season+'</span>'    :'')
                + (episode              ?  '<span class="'+$(this).data('class-episode')    +'">E'  +(episode.match(/^\d\d/)?'':'0')+episode+'</span> ' :'')
                + (artist               ? ' <span class="'+$(this).data('class-artist')     +'">'   +artist+' - </span>'                                :'')
                + (album                ? ' <span class="'+$(this).data('class-album')      +'">'   +album+' - </span>'                                 :'')
                + (title                ? ' <span class="'+$(this).data('class-title')      +'">'   +title+ '</span> '                                  :'')
                + (time || totaltime    ? ' [ ' : '')
                + (time                 ?  '<span class="'+$(this).data('class-time')       +'">'   +time+'</span>'                                     :'')
                + (time && totaltime    ?  ' / ' : '')
                + (totaltime            ?  '<span class="'+$(this).data('class-totaltime')  +'">'   +totaltime+'</span>'                                :'')
                + (time || totaltime    ? ' ] ' : '')
                + (playStatus && playStatus!="playing"? ' <span class="'+$(this).data('class-playstatus') +'">(' +playStatus+')</span> '                :'')
            );
        });
    }
});

Wie kann ich sowas bei mir einbinden? Sorry für die Anfänger frage

Gesendet von meinem FRD-L09 mit Tapatalk


eisi

Du gehst in dein /www/tablet/js Verzeichnis.
Da legst du eine widget_kodinowplaying.js Datei an.
Editierst diese Datei und fügst den Code ein.

LG,
Ingo
3 x Rasp mit fhem 5.8 | 1 Rasp mit Kodi |1x Cube | 15 x MaxLan Thermostate und 18 Fensterschalter | 30 WLAN Schalter Sonoff | Diverse Sensoren mit Arduino | Tablet mit FTUI 2.6

masterpete23

gesagt getan.

widget_kodinowplaying.js angelegt und gefüllt.

was trage ich im HTML ein ?
<div data-type="kodinowplaying" data-device="wz_kodi" data-get="volume"></div>

Rudy


eisi

Sorry für die späte Antwort.


<div data-type="mywidget" data-device='Kodi.WoZi'
         data-get='["type","season","episode","currentShowtitle","currentTitle","time","totaltime",
        "playStatus","currentAlbum","currentArtist","label"]'></div>
3 x Rasp mit fhem 5.8 | 1 Rasp mit Kodi |1x Cube | 15 x MaxLan Thermostate und 18 Fensterschalter | 30 WLAN Schalter Sonoff | Diverse Sensoren mit Arduino | Tablet mit FTUI 2.6

masterpete23

welchen data-type muss ich denn nehmen?
Stehe auf dem Schlauch

eisi

Also bei mir binde ich es so ein:


<li data-row="2" data-col="4" data-sizex="3" data-sizey="1">
        <header>Kodi Wohnzimmer</header>
        <div class="top-space">
            <div class="inline" data-type="button" data-fhem-cmd="set Kodi.WoZi exec rewind" data-icon="fa-backward" data-on-background-color="rgb(170,105,0)" class="cell"></div>
            <div class="inline" data-type="button" data-fhem-cmd="set Kodi.WoZi pause all" data-icon="fa-pause" data-on-background-color="rgb(170,105,0)" class="cell"></div>
            <div class="inline" data-type="button" data-fhem-cmd="set Kodi.WoZi play all" data-icon="fa-play" data-on-background-color="#FFCC00" class="cell"></div>
            <div class="inline" data-type="button" data-fhem-cmd="set Kodi.WoZi stop all" data-icon="fa-stop" data-on-background-color="rgb(170,105,0)" class="cell"></div>
            <div class="inline" data-type="button" data-fhem-cmd="set Kodi.WoZi exec fastforward" data-icon="fa-forward" data-on-background-color="rgb(170,105,0)" class="cell"></div>
        </div>
        <div data-type="mywidget" data-device='Kodi.WoZi'
         data-get='["type","season","episode","currentShowtitle","currentTitle","time","totaltime",
        "playStatus","currentAlbum","currentArtist","label"]'></div>
    </li>

3 x Rasp mit fhem 5.8 | 1 Rasp mit Kodi |1x Cube | 15 x MaxLan Thermostate und 18 Fensterschalter | 30 WLAN Schalter Sonoff | Diverse Sensoren mit Arduino | Tablet mit FTUI 2.6

masterpete23

woher weiß er nun , dass dein <div data-type="mywidget" zu der widget_kodinowplaying.js gehört - das verstehe ich nicht

eisi

Ups, sorry, hatte die falsche Datei gegriffen :-(

"use strict";

var Modul_mywidget = function () {
    var readings =[];
    function init_attr(elem) {

        elem.initData('get', 'STATE');
        me.addReading(elem, 'get');

        this.elements.each(function(index) {
            if($(this).hasClass('titleonly')){
                $(this).attr('data-show', 'no');
                $(this).attr('data-season', 'no');
                $(this).attr('data-episode', 'no');
                $(this).attr('data-label', 'yes');
                $(this).attr('data-artist', 'no');
                $(this).attr('data-album', 'no');
                $(this).attr('data-time', 'no');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'no');
            } else if($(this).hasClass('short')){
                $(this).attr('data-show', 'yes');
                $(this).attr('data-season', 'no');
                $(this).attr('data-episode', 'no');
                $(this).attr('data-label', 'yes');
                $(this).attr('data-artist', 'no');
                $(this).attr('data-album', 'no');
                $(this).attr('data-time', 'yes');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'no');
            } else if($(this).hasClass('notime')){
                $(this).attr('data-show', 'yes');
                $(this).attr('data-season', 'yes');
                $(this).attr('data-episode', 'yes');
                $(this).attr('data-label', 'yes');
                $(this).attr('data-artist', 'yes');
                $(this).attr('data-album', 'yes');
                $(this).attr('data-time', 'no');
                $(this).attr('data-totaltime', 'no');
                $(this).attr('data-playstatus', 'yes');
            }
            $(this).data('type', 'type');
            readings['type'] = true;
            if(!$(this).attr('data-show') || $(this).attr('data-show')=='yes') {
                $(this).data('currentShowtitle', 'currentShowtitle');
                readings['currentShowtitle'] = true;
            }
            if(!$(this).attr('data-season') || $(this).attr('data-season')=='yes') {
                $(this).data('season', 'season');
                readings['season'] = true;
            }
            if(!$(this).attr('data-episode') || $(this).attr('data-episode')=='yes') {
                $(this).data('episode', 'episode');
                readings['episode'] = true;
            }
            if(!$(this).attr('data-label') || $(this).attr('data-label')=='yes') {
                $(this).data('label', 'label');
                readings['label'] = true;
            }
            if(!$(this).attr('data-artist') || $(this).attr('data-artist')=='yes') {
                $(this).data('currentArtist', 'currentArtist');
                readings['currentArtist'] = true;
            }
            if(!$(this).attr('data-album') || $(this).attr('data-album')=='yes') {
                $(this).data('currentAlbum', 'currentAlbum');
                readings['currentAlbum'] = true;
            }
            if(!$(this).attr('data-time') || $(this).attr('data-time')=='yes') {
                $(this).data('time', 'time');
                readings['time'] = true;
            }
            if(!$(this).attr('data-totaltime') || $(this).attr('data-totaltime')=='yes') {
                $(this).data('totaltime', 'totaltime');
                readings['totaltime'] = true;
            }
            if(!$(this).attr('data-playstatus') || $(this).attr('data-playstatus')=='yes') {
                $(this).data('playStatus', 'playStatus');
                readings['playStatus'] = true;
            }
            console.log (readings);
        });
    }

    function update(dev, par) {
        me.elements.filterDeviceReading('get', dev, par).each(function (index) {
            var elem = $(this);
            var get = elem.data('get');
            var part = elem.data('part');
            var val = [];
            var type ="";
            var season ="";
            var episode ="";
            var currentShowtitle ="";
            var currentTitle ="";
            var time ="";
            var totaltime ="";
            var playStatus ="";
            var currentArtist ="";
            var currentAlbum ="";
            var title ="";
            var show ="";
            var label ="";
            var html ="";

            var value = elem.getReading('get', 0).val;
            type = ftui.getPart(value, part);
            var value = elem.getReading('get', 1).val;
            season = ftui.getPart(value, part);
            var value = elem.getReading('get', 2).val;
            episode = ftui.getPart(value, part);
            var value = elem.getReading('get', 3).val;
            show = ftui.getPart(value, part);
            var value = elem.getReading('get', 4).val;
            currentTitle = ftui.getPart(value, part);
            var value = elem.getReading('get', 5).val;
            time = ftui.getPart(value, part);
            var value = elem.getReading('get', 6).val;
            totaltime = ftui.getPart(value, part);
            var value = elem.getReading('get', 7).val;
            playStatus = ftui.getPart(value, part);
            var value = elem.getReading('get', 8).val;
            currentAlbum = ftui.getPart(value, part);
            var value = elem.getReading('get', 9).val;
            currentArtist = ftui.getPart(value, part);
            var value = elem.getReading('get', 10).val;
            label = ftui.getPart(value, part);


            var dateformat = $(this).attr('data-timeformat');
            if(!dateformat) {
                switch(type) {
                    case "song": dateformat = 'MM:SS'; break;
                    default: dateformat = 'HH:MM:SS'; break;
                }
            }
            var subst = '';
            if(dateformat) {
                switch(dateformat.toUpperCase()) {
                    case "HH":          subst = '$1'; break;
                    case "HH:MM":       subst = '$1:$2'; break;
                    default:
                    case "HH:MM:SS":    subst = '$1:$2:$3'; break;
                    case "MM:SS":       subst = '$2:$3'; break;
                    case "SS":          subst = '$3'; break;
                }
            }
            if(subst) {
                if(time) {
                    time = time.replace(/^(\d\d):(\d\d):(\d\d).(.*)/, subst);
                }
                if(totaltime) {
                    totaltime = totaltime.replace(/^(\d\d):(\d\d):(\d\d).(.*)/, subst);
                }
            }

                if (readings['label'] && label){
                        html= html + ' '+ label +' '
                }
                if (readings['show'] && show){
                        html= html + show+' '
                }
                if (readings['season'] && season){
                        html= html + 'S'+season+' '
                }
                if (readings['episode'] && episode){
                        html= html + 'E'+ episode +' '
                }
                if (readings['currentArtist'] && currentArtist){
                        html= html + ' '+ currentArtist +':'
                }
                if (readings['currentAlbum'] && currentAlbum){
                        html= html + ' '+ currentAlbum +':'
                }
                if (readings['time']|| readings['totaltime']){
                        html= html + '[ '
                }
                if (readings['time']){
                        html= html + ' ' + time
                }
                if (readings['time']&& readings['totaltime']){
                        html= html + '/'
                }
                if (readings['totaltime']){
                        html= html + ' ' + totaltime
                }
                if (readings['time']|| readings['totaltime']){
                        html= html + ']'
                }
                if (readings['playStatus']|| readings['playStatus']){
                        html= html + ' (' +playStatus + ')'
                }
                elem.html(html);
        })
    }

    var me = $.extend(new Modul_widget(), {
        widgetname: 'mywidget',
        init_attr: init_attr,
        update: update,

    });

    return me;
}
3 x Rasp mit fhem 5.8 | 1 Rasp mit Kodi |1x Cube | 15 x MaxLan Thermostate und 18 Fensterschalter | 30 WLAN Schalter Sonoff | Diverse Sensoren mit Arduino | Tablet mit FTUI 2.6

masterpete23

#25
super ich sehe was :)
nun fehlen nur noch die knöpfe :)

eisi

Die Knöpfe hab ich doch weiter oben :-) Schau mal :-)
3 x Rasp mit fhem 5.8 | 1 Rasp mit Kodi |1x Cube | 15 x MaxLan Thermostate und 18 Fensterschalter | 30 WLAN Schalter Sonoff | Diverse Sensoren mit Arduino | Tablet mit FTUI 2.6

pula

#27
Hört sich super an, vielen Dank! :-)

Mal so eine kleine Zusatzfrage: Weiß jemand, ob es auch eine Möglichkeit gibt, von kodi das aktuelle channel-logo zu bekommen (wenn man die PVR-Funktion nutzt). Wäre super, wenn man in ftui das Logo auch anzeigen lassen könnte....

Aber soweit ich auf die schnelle jetzt gesehen habe, gibt kodi das zur Zeit nicht her :-(

Cheers,

Pula
fhem (debian auf proxmox), HM-LAN und wired, MySensors, FritzBoxes, Kodi, vdr, Onkyo, squeezeplayers, nanoCUL, wifilight (Ethernet-Bridge), Heizungssteuerung (python/vncdotool), doorpi, ESP/Arduinos/MQTT, Alexa, HomeConnect, Sonoff/Tasmota, espRGBWW, esphome, Telegram

eisi

Hm, da muss ich schauen. Wenn das FHEM-Modul das weitergeben kann, ist das wohl irgendwie machbar.
Ich kann nicht wirklich Javascript. PHP wäre da nur von Vorteil, aber das UI will halt Javascript :-(
Wird wohl was dauern.
3 x Rasp mit fhem 5.8 | 1 Rasp mit Kodi |1x Cube | 15 x MaxLan Thermostate und 18 Fensterschalter | 30 WLAN Schalter Sonoff | Diverse Sensoren mit Arduino | Tablet mit FTUI 2.6

masterpete23

langsam wird es spannend :)