Skip to content

Instantly share code, notes, and snippets.

@tbaumann
tbaumann / Smartknob_simple_Blueprint.yaml
Last active November 30, 2023 18:34
Simple blueprint
blueprint:
name: ZHA - Moes Smart Knob for lights
description: 'Control lights with a Moes Smart Knob.
You can set functions for a single press. This allows you to assign, e.g., a scene
or anything else.
Rotating left/right will change the brightness smoothly of the selected light.
Not all functionality of the device is available at time of writing, e.g. double
press, long press and press and rotate.
Original blueprint by seamus65 (https://gist.github.com/seamus65/939a147634942dd885c8704334627f93).
Improved by GonzaloAlbito (https://gist.github.com/gonzaloalbito/3dc06702e941e08298ea9bfade731731).
@tbaumann
tbaumann / Blueprint.yaml
Last active November 30, 2023 18:17
Smart knob blueprint
blueprint:
name: ZHA - Tuya - TS004F Rotating Knob - Custom Actions
description: >-
This automation adds triggers for all actions of the Tuya TS004F rotating knob remote.
It can be used in both Command/Dimmer and Event/Scene mode. Both modes have their own actions.
In Command/Dimmer mode the config is mostly internal except for pressing the button.
In Event/Scene mode you can select your own actions.
@tbaumann
tbaumann / plan.yaml
Last active June 7, 2023 16:26
Local charm updater
## Origin https://docs.openstack.org/charm-guide/latest/admin/upgrades/charms.html#upgrade-order
## Two matches are possible
## 1. charms: [regex, ..] matches on the full name of the charm not the application name in the model (regex supported)
## 2. apps: [regex, ..] matches on the full name of the app in the model (regex supported)
## Examples
## apps: [nova-compute-.*] would match nova-compute-dedicated and nova-compute-shared
## charms: [nova-compute ] would also match nova-compute-dedicated and nova-compute-shared and any other instances of the nova-compute charm
- name: 010_mysql
charms:
@tbaumann
tbaumann / bashrc.sh
Created October 27, 2016 11:22
Enable virtualenv in git repos if .venv is available
## Put this in your .bashrc
function workon_cwd {
if git rev-parse --is-inside-work-tree > /dev/null 2>/dev/null
then
REPO_TOPLEVEL=`git rev-parse --show-cdup`
if [ -f "./$REPO_TOPLEVEL/.venv" ]
then
ENV_NAME=`cat "./$REPO_TOPLEVEL/.venv"`

I hereby claim:

  • I am tbaumann on github.
  • I am tilmanbaumann (https://keybase.io/tilmanbaumann) on keybase.
  • I have a public key whose fingerprint is 2549 CDAC B21D 727D B03E 1D19 3FEB 706F 8D6A B949

To claim this, I am signing this object:

{