Skip to content

Instantly share code, notes, and snippets.

@TheRealSimon42
TheRealSimon42 / configuration.yaml
Created July 2, 2023 14:19
Code-Snippet für Template-Sensor zur Berechnung eines Timestamps aus input Helper
template:
- sensor:
- name: WakeUp Light Timestamp
device_class: timestamp
state: >
{% if is_state("binary_sensor.workday_sensor", "on") %}
{{ today_at(states('input_datetime.aufwachzeit_arbeitstag')) }}
{% elif is_state("binary_sensor.workday_sensor", "off") %}
{{ today_at(states('input_datetime.aufwachzeit_freizeit')) }}
{% endif %}
@TheRealSimon42
TheRealSimon42 / functions.php
Last active April 16, 2022 22:27
Function to Prealod CSS FIles in WordPress via Function
/** Head Style Preloading **/
function style_preloading_preload_key_requests() { ?>
<link rel="preload" as="style" href="/wp-content/themes/navigation-pro/style.css" crossorigin="anonymous">
<?php }
add_action( 'wp_head', 'style_preloading_preload_key_requests' );
@TheRealSimon42
TheRealSimon42 / watermodes.js
Created March 21, 2022 12:27
Edited for 1% = No mopping
"use strict";
module.exports = {
// S5-Max (https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/issues/79#issuecomment-576246934)
gen1: [
// 0% = Off
{
homekitTopLevel: 1,
miLevel: 200,
name: "Off",