Code Monkey home page Code Monkey logo

lovelace-media-player-dynamic-groups's Introduction

Media Player Dynamic Groups Card

Media Player Dynamic Groups is a card to help dynaically show media_players depending on which speakers/speaker groups are currently playing.

Screenshot - Expanded Group Volume Controls Screenshot - Collapsed Group Volume Controls

Required

Options

Name Type Requirement Description Default
type string Required media-player-dynamic-groups
title string Optional Header of the card
cards object Required The media_player card you want to embed. Note this card must have a property called entity none
media_player_tree object Required The tree of Media Player Entities used to determine which media_player(s) is/are currently shown. See Media Player Tree Object
keep object Optional See keep object. Come directly from stack-in-card.

Media Player Tree Object

| Name | Type | Requirement | Description | | entityId | string | true | 'entityId' of a media player | | children | MediaPlayerTree[] | false | Optional additional MediaPLayerTree child objects |

Keep Object

Name Type Requirement Description Default
background boolean Optional Will keep the background on all the child cards. To keep the background on specific cards only, assign the CSS variable --keep-background: 'true' on the card where you want to keep the background. false
box_shadow boolean Optional Will keep the box-shadow on all the child cards false
margin boolean Optional Will keep the margin between all the child cards false
outer_padding boolean Optional Will add a padding of 8px to the card if margin is true true if margin is true, else false
border_radius boolean Optional Will keep the border-radius on all the child cards false

Example Card Config Yaml

Note: 'media_player_group_tree' must be made entirely of media_player entities and have only 1 entity at it's root.

type: 'custom:group-media-players'
media_player_group_tree:
  entityId: media_player.all_speakers
  children:
    - entityId: media_player.upstairs_speakers
      children:
        - entityId: media_player.office_speaker
        - entityId: media_player.bedroom_speaker
        - entityId: media_player.stairs_speaker
        - entityId: media_player.bedroom_clock
    - entityId: media_player.downstairs_speakers
      children:
        - entityId: media_player.living_room_speaker
        - entityId: media_player.kitchen_speaker
        - entityId: media_player.poker_room_speaker
card:
  type: 'custom:mini-media-player'
  artwork: cover
  hide:
    power: true
    icon: true
    source: true

Installation

Use HACS or follow this guide

Raw Yaml Configuration for HACS

resources:
  - url: /community/media-player-dynamic-groups/media-player-dynamic-groups.js
    type: js

Special Thanks

Templated from stack-in-card

  • Great code here. Really helped with managing state through various sub-cards.

Notice

  • Still in development.
  • This is software I write in my freetime to make Home Assistant's UI better for my own personal use! I'm happy to share it! But please know you are using it at your own risk! :)

lovelace-media-player-dynamic-groups's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.