Skip to content

Instantly share code, notes, and snippets.

# As there is currently no proper way to semantically model entities in ETS
# I assume everybody has some kind of group address configuration scheme
# (there are "functions" but as far as I can see they are not really usable
# at the moment and also not "migratable" from an existing GA structure).
#
# I want to have the single source ETS with rule based imports and no manual
# edits of them within Hass. With rerunning the rules after an ETS export
# you have all additions (or deletions?) reflected without adding anything
# in two places. At least in my configuration I can always assume there is
# at least one leading group address in order to define an entity.
@elupus
elupus / gist:0f8f3f98eb97cba3e1dc2f20a4564fef
Last active November 8, 2022 10:42
Blueprint: IKEA Symfonisk to KNX dimmer
blueprint:
name: IKEA Symfonisk Rotary Dimmer
description: Use symfonisk as knx relative dimmer
domain: automation
input:
rotary_device:
name: Source device
selector:
device:
integration: zha
@numberoverzero
numberoverzero / async_value.py
Created July 6, 2015 02:50
Variable that can be `await`ed on to reach a certain value, without blocking an event loop
import asyncio
missing = object()
class Value:
'''
Simple class that enables `await value.wait_for(foo)` to wait until the
variable is set to the expected value, without blocking the event loop.
Loosely modeled after asyncio.Event and asyncio.Condition