Skip to content

Instantly share code, notes, and snippets.

View tillbaks's full-sized avatar

Johannes tillbaks

  • Malmö, Sweden
View GitHub Profile
@tillbaks
tillbaks / Helpers.txt
Last active August 21, 2022 13:28
Home Assistant Config for IR receivers (SMSL Q5 Pro example)
Some Home Assistant Helpers which are used in the script:
Name: Stereo Volume
Entity ID: input_number.stereo_volume
Minimum: 1
Maximum: 60
Step Size: 1
Name: Stereo Bass
Entity ID: input_number.stereo_bass
@tillbaks
tillbaks / storable.js
Created August 26, 2020 18:49
Svelte writable store that stores its value in localStorage. Does json parsing and stringifying if initial value is an object/array.
import { writable } from "svelte/store";
/**
* Svelte writable store that stores its value in localStorage.
* Does json parsing and stringifying if initial value is an object/array.
*
* @param {string} key localStorage-key
* @param {string|number|boolean|object|array} initialValue the initial value of the store (also the value that can be reset to with the reset() function)
**/
export const storable = (key, initialValue) => {
@tillbaks
tillbaks / amplifier_manager.py
Last active November 15, 2021 18:51
Home Assistant AppDaemon plugin to make dumb amplifier smart (SMSL Q5Pro)
import appdaemon.plugins.hass.hassapi as hass
from time import sleep
from threading import Lock
#
# SMSL Q5 Pro (Amplifier Manager)
# Amplifiers like the SMSL Q5 Pro can with this App be controlled with sliders for
# volume, bass and treble and an input_select for the input source
#
# Expected (configuration.yaml):