This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simplest possible custom card | |
// Does nothing. Doesn't look like anything | |
class MyCustomCard extends HTMLElement { | |
setConfig(config) { | |
// The config object contains the configuration specified by the user in ui-lovelace.yaml | |
// for your card. | |
// It will minimally contain: | |
// config.type = "custom:my-custom-card" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PREV_PROPERTY = "prev-log" | |
const NEXT_PROPERTY = "next-log" | |
const LOG_PATH = "Log/"; | |
/* | |
This will set the prev-log and next-log properties of the current file to the previous and next daily log files. | |
It also updates the properties of the previous and next files to point correctly. | |
Requires the file title to be the date, and nothing else. | |
The script requires access to tp, so call it with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Xiaomi vacuum- clean rooms | |
description: | | |
## Clean the specified rooms | |
This works for Xiaomi vacuum cleaners which have room recognition and cleaning. | |
Vacuum specific rooms based on the state of a number of [Toggle Helper entities](/config/helpers) (`input_boolean`). | |
**This automation does not have any own triggers, but must be triggered manually or by an | |
`automation.trigger` service call.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- variables: | |
color: >- | |
{{["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", | |
"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", | |
"burlywood", "cadetblue", "chartreuse", "chocolate", "coral", | |
"cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", | |
"darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", | |
"darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", | |
"darksalmon", "darkseagreen", "darkslateblue", "darkslategray", | |
"darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Shortens output filenames for all printers in prusa config folder. | |
Will turn filename into: {input_filename_base}_{nozzle_size}_{printing_filament_types}_{print_time}.gcode | |
Place this file in your PrusaSlicer config folder (Help->Show Configuration Folder) and run it with python. | |
Make a backup first. | |
/ Thomas Lovén 2024 | |
""" | |
import glob | |
import configparser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /config/configuration.yaml | |
... | |
lovelace: | |
mode: yaml | |
resources: | |
- url: /local/myfont.css | |
type: css | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LitElement, html } from "lit"; | |
import { customElement, property } from "lit/decorators.js"; | |
import { ScopedRegistryHost } from "@lit-labs/scoped-registry-mixin"; | |
@customElement("customelement-test") | |
class CustomElementTest extends ScopedRegistryHost(LitElement) { | |
@property() hass; | |
static elementDefinitions = { | |
"ha-card": customElements.get("ha-card"), // This works because ha-card is ALWAYS loaded before custom cards (for now) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to your lovelace resources as | |
// url: /local/chart-colors.js | |
// type: module | |
customElements.whenDefined('ha-chart-base').then(() => { | |
// Find the HaChartBase class | |
const HaChartBase = customElements.get('ha-chart-base'); | |
// Write a new color list generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hass:account | |
hass:alert | |
hass:alert-circle | |
hass:altimeter | |
hass:apple-safari | |
hass:apps | |
hass:arrow-bottom-left | |
hass:arrow-down | |
hass:arrow-left | |
hass:arrow-right |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
To move a panel to below the divider in Home Assistant | |
Add this to your configuration.yaml | |
frontend: | |
extra_module_url: | |
- /local/move-panel.js | |
And put the following into <config-dir>/www/move-panel.js | |
Replace URL_TO_MOVE with the url of your panel |
NewerOlder