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 6, 2026 16:53
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 HA group of lights and use the full power of a Hue Switch v2.
**➡️ Pro-tip:** if you’re using ZHA, consider the [ZHA-native version of this blueprint](https://community.home-assistant.io/), which controls lights directly at the Zigbee (hardware) level.
The current version relies on Home Assistant light services and simulates stepless dimming by issuing repeated brightness commands.
@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