Skip to content

Instantly share code, notes, and snippets.

View brucefoster's full-sized avatar
🎯
Focusing

Alexander brucefoster

🎯
Focusing
View GitHub Profile
blueprint:
name: "Tradfri Wrapper Dev"
description: >
### Workaround for animating both color and brightness in IKEA Tradfri bulbs
These bulbs are notorious for all sorts of glitches when trying to animate brightness and color simultaneously.
This script will help to animate brightness first and then will animate color or color temperate.
### Usage
blueprint:
name: "Tradfri Wrapper"
description: >
### Workaround for animating both color and brightness in IKEA Tradfri bulbs
These bulbs are notorious for all sorts of glitches when trying to animate brightness and color simultaneously.
This script will help to animate brightness first and then will animate color or color temperate.
### Usage
@brucefoster
brucefoster / hue_switch_v2.yaml
Last active January 20, 2025 17:55
Philips Hue Switch Light Controller for Home Assistant
blueprint:
name: Control Lights with Philips Hue Switch (ZHA)
author: "Sascha B."
description: >
### Bind your light or a group of lights and use the full power of a Hue Switch v2.
«On/off» button:
- click to turn the light or on off,
- hold to turn on with minimal brightness,
- click twice to turn on with max brightness or to exit a scene.
@brucefoster
brucefoster / merger.php
Created January 17, 2015 20:20
Multiple file merger (PHP)
<?php
class Merger {
private static $mergePending = array();
private static $mergeStats = array();
/* public static function mergeFiles
* @var mixed $filesArray array of names of files (including directories) to merge from
* @var string $destinationFile name of file to save merged files to
* @var mixed $splitterFunction anonymous function providing splitting of each file, in: string, out: array of items
* @var mixed $joinerFunction anonymous function providing merging all files with delimiter, in: array of items, out: string