11import { HomeAssistant } from 'custom-card-helpers' ;
2- import { CardConfig , GetQueueResponse , MediaPlayerItem , Section , TemplateResult } from '../types' ;
2+ import { GetQueueResponse , MediaPlayerItem , Section , TemplateResult } from '../types' ;
33import { ServiceCallRequest } from 'custom-card-helpers/dist/types' ;
44import { CALL_MEDIA_DONE , CALL_MEDIA_STARTED } from '../constants' ;
55import { MediaPlayer } from '../model/media-player' ;
@@ -9,13 +9,11 @@ export default class HassService {
99 private readonly hass : HomeAssistant ;
1010 private readonly currentSection : Section ;
1111 private readonly card : Element ;
12- private readonly config : CardConfig ;
1312
14- constructor ( hass : HomeAssistant , section : Section , card : Element , config : CardConfig ) {
13+ constructor ( hass : HomeAssistant , section : Section , card : Element ) {
1514 this . hass = hass ;
1615 this . currentSection = section ;
1716 this . card = card ;
18- this . config = config ;
1917 }
2018
2119 async callMediaService ( service : string , inOptions : ServiceCallRequest [ 'serviceData' ] ) {
@@ -27,22 +25,6 @@ export default class HassService {
2725 }
2826 }
2927
30- async browseMedia ( mediaPlayer : MediaPlayer , media_content_type ?: string , media_content_id ?: string ) {
31- const mediaPlayerItem = await this . hass . callWS < MediaPlayerItem > ( {
32- type : 'media_player/browse_media' ,
33- entity_id : mediaPlayer . id ,
34- media_content_id,
35- media_content_type,
36- } ) ;
37- if ( this . config . mediaBrowser ?. favorites ?. replaceHttpWithHttpsForThumbnails ) {
38- mediaPlayerItem . children = mediaPlayerItem . children ?. map ( ( child ) => ( {
39- ...child ,
40- thumbnail : child . thumbnail ?. replace ( 'http://' , 'https://' ) ,
41- } ) ) ;
42- }
43- return mediaPlayerItem ;
44- }
45-
4628 async renderTemplate < T > ( template : string , defaultValue : T ) : Promise < T > {
4729 return new Promise < T > ( ( resolve ) => {
4830 const subscribeMessage = {
0 commit comments