Skip to content

Instantly share code, notes, and snippets.

View connor4312's full-sized avatar

Connor Peet connor4312

View GitHub Profile
@connor4312
connor4312 / configuration.yaml
Created February 27, 2021 06:20
Home Assistant docker-compose with zigbee2mqtt
# Add this to your Home Assistant config
mqtt:
broker: localhost
discovery: true
birth_message:
topic: 'hass/status'
payload: 'online'
will_message:
topic: 'hass/status'
@connor4312
connor4312 / readme.md
Last active May 1, 2021 09:27
Test API

Requirements

  1. Load tests asynchronously, and gradually (pull from extension)
  2. Listen to test changes, new children, and removal of children (push from extension)
  3. Be able to place tests in the tree concurrently with a test run as results are reported (push from extension)
  4. Be able to stop listening to tests from a child
  5. Allow the extension to identity its tests in whatever "run test" mechanism there is

Approaches

@connor4312
connor4312 / prefix-tree.ts
Created March 28, 2022 03:14
A small serializable prefix tree
export interface ISerializer<T> {
toBinary(value: T): Uint8Array;
fromBinary(value: Uint8Array): T;
}
// example serializer for uuids
import * as uuid from "uuid";
export const uuidSerializer: ISerializer<string> = {
toBinary: (id) => uuid.parse(id) as Uint8Array,
fromBinary: (id) => uuid.stringify(id),