Coder Social home page Coder Social logo

jb-battery-card's Introduction

jb-battery-card

Home Assistant Batter Card

Horizontal Vertical with variant=simple
Horizontal Vertical

Several devices in a grid

Grid

Config

Name Type Default Description
type string custom:jb-battery-card
entity string your entity id
title string your device name
horizontal bool false (optional) enable horizontal card layout
variant string (optional) icons variant. At this moment can be set only to "simple" or not set at all
colors object (optional) color config for battery level

Example

type: custom:jb-battery-card
entity: sensor.rmx3085_battery_level_2
title: Realme
horizontal: false
variant: simple
colors:
  '0': '#bf360c'
  '15': '#ad6b0d'
  '33': '#827717'
  '66': '#1b5e20'

How colors works here?

Card itsef provides nice colors depends on battery level. But you can override it with your own colors. Looking on the example above:

  • from 0 to 14 #bf360c will be used
  • from 15 to 32 #ad6b0d will be used
  • from 33 to 65 #827717 will be used
  • from 66 to 100 #1b5e20 will be used

Of course, you can specify additional colors for other levels.

Disable batttery level colors

If you do not want to set colors depends on battery level, just set only one entry in colors property like that:

...
colors:
  '0': '#999999'

This way battery icon will always be gray no matter what is the battery level.

jb-battery-card's People

Contributors

drakulis avatar

Watchers

 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.