Skip to content

Instantly share code, notes, and snippets.

View iantrich's full-sized avatar
🍺
Cheers!

Ian Richardson iantrich

🍺
Cheers!
View GitHub Profile
- type: 'custom:button-card'
name_template: >
function activeCount(group, active) {
var entities = states[group].attributes.entity_id;
var count = 0;
for ( var entity in entities ) {
if ( states[entities[entity]] && states[entities[entity]].state === active ) {
count++;
}
@iantrich
iantrich / summary-card.final
Created July 21, 2019 04:02
summary-card final
- path: summary
title: Summary
badges: []
panel: true
cards:
- type: vertical-stack
cards:
# If device is not a phone, show a clock and date
- type: 'custom:button-card'
name_template: >
platform: generic
name: Ian
still_image_url: "https://maps.googleapis.com/maps/api/staticmap?center={{ states.device_tracker.ian.attributes.latitude }},{{ states.device_tracker.ian.attributes.longitude }}&zoom=16&size=500x500&maptype=roadmap&markers=color:purple%7Clabel:I%7C{{ states.device_tracker.ian.attributes.latitude }},{{ states.device_tracker.ian.attributes.longitude }}&key={my_key}}"
limit_refetch_to_url_change: true
weather_tap_action: &weather_tap_action
tap_action:
action: call-service
service: browser_mod.command
service_data:
command: popup
title: 'Weather'
deviceID:
- this
card:
type: custom:button-card
entity: weather.dark_sky
show_name: false
aspect_ratio: 1/1
icon: >
[[[
var icon = "mdi:weather-" + entity.state;
switch (entity.state) {
case "overcast":
icon = "mdi:weather-cloudy-arrow-right";
@iantrich
iantrich / sensor.py
Created August 7, 2019 15:25
feedparser back to dict
"""
A component which allows you to parse an RSS feed into a sensor
For more details about this component, please refer to the documentation at
https://github.com/custom-components/sensor.feedparser
Following spec from https://validator.w3.org/feed/docs/rss2.html
"""
import re
import feedparser
anchors:
decluttering_album: &decluttering_album
type: custom:decluttering-card
template: album
coverflow_card: &coverflow_card
type: custom:swipe-card
parameters:
effect: 'coverflow'
grabCursor: true
centeredSlides: true
const LitElement = Object.getPrototypeOf(customElements.get("hui-view"));
const html = LitElement.prototype.html;
class TextDividerRow extends LitElement {
static get properties() {
return {
_config: {}
};
}
{
"data": {
"172733314": {
"authors": [
"@ludeeus"
],
"category": "integration",
"description": "Manage (Install, track, upgrade) and discover custom elements for Home Assistant.",
"full_name": "custom-components/hacs",
"hide": false,
type: picture-elements
image: https://i.scdn.co/image/1ee2055a078d87a5a55366189409b9e1d820972a
elements:
- type: icon
icon: mdi:play
tap_action:
action: call-service
service: spotcast.start
service_data:
device_name: Office Display