Skip to content

Instantly share code, notes, and snippets.

View nstrelow's full-sized avatar
💭
👨‍💻

Nils Strelow nstrelow

💭
👨‍💻
View GitHub Profile
@nstrelow
nstrelow / sensor-light.yaml
Last active December 11, 2023 21:53 — forked from Blackshome/sensor-light.yaml
Home Assistant Sensor Light that can be used in Blueprints
blueprint:
name: Sensor Light
description: >
# 💡 Sensor Light
**Version: 5.1.1**
The most common automation used for a sensor light.
@nstrelow
nstrelow / zha-tuya-4-button-scene-switch-ts004f.yaml
Last active October 18, 2022 21:09
ZHA - Tuya 4-button Scene Switch (TS004f)
blueprint:
name: ZHA - Tuya 4-Button Scene Switch
description: Automate your Tuya 4-Button Scene Switch using ZHA events.
domain: automation
input:
tuya_4button_scene_switch:
name: Tuya 4-Button Scene Switch
description: Tuya 4-Button Scene Switch to use
selector:
device:
@nstrelow
nstrelow / main.dart
Last active March 21, 2021 17:54
Nullable default parameter
void main() {
String? nullableButHasValue = 'hello';
String? nullableAndIsNull;
func1(password: nullableButHasValue); //<-- Works, because the check registers, that is has a value
//func1(password: nullableAndIsNull); //<-- Errors, bc param is non-nullable and has no value.
//func1(param: null); //<-- Errors, bc param is non-nullable
func2(); // Works as expected
func2(password: null); // password is set to null, instead of 'test-nullable'