Skip to content

Instantly share code, notes, and snippets.

View AdamStrojek's full-sized avatar

Adam Strojek AdamStrojek

View GitHub Profile
@AdamStrojek
AdamStrojek / prepare-commit-msg
Last active July 11, 2019 09:00
Prepend a Jira Issue ID to Git Commit Messages
#!/bin/sh
# To install it just enter in project:
# if [ -d .git/hooks ]; then HOOKF=.git/hooks/prepare-commit-msg && if [ ! -f $HOOKF ]; then curl -s https://gist.githubusercontent.com/AdamStrojek/c3ad92916acec6963e0a198cc9d14946/raw > $HOOKF && chmod 755 $HOOKF; else echo "Error: $HOOKF exists"; fi else echo "Error: Not a git repo"; fi
COMMIT_FILE=$1
COMMIT_MSG=$(cat $1)
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
JIRA_ID=$(echo "$CURRENT_BRANCH" | grep -Eo "[A-Z0-9]{1,10}-?[A-Z0-9]+-\d+")
import logging
import voluptuous as vol
# Import the device class from the component that you want to support
from homeassistant.components.light import (
ATTR_BRIGHTNESS, Light, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS)
from homeassistant.const import CONF_HOST, CONF_NAME
import homeassistant.helpers.config_validation as cv
device_tracker:
- platform: mqtt
devices:
adam: 'blescan/presence/adamkeys'
@AdamStrojek
AdamStrojek / tplink.py
Last active February 9, 2020 18:55
This is temporary fix for TP-Link HS110 after firmware upgrade for Home Assistant. Just save this file to `custom_components/switch` folder in config folder and it will replace original component from Home Assistant. I have changed how requirements are provided so it will install current version of pyHS100 with required patches to work. No more …