Skip to content

Instantly share code, notes, and snippets.

View iantrich's full-sized avatar
🍺
Cheers!

Ian Richardson iantrich

🍺
Cheers!
View GitHub Profile
const LitElement = Object.getPrototypeOf(customElements.get("hui-view"));
const html = LitElement.prototype.html;
class TextDividerRow extends LitElement {
static get properties() {
return {
_config: {}
};
}
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
@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
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";
weather_tap_action: &weather_tap_action
tap_action:
action: call-service
service: browser_mod.command
service_data:
command: popup
title: 'Weather'
deviceID:
- this
card:
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
@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: >
- 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++;
}