The gubbins and configuration files for integrating a McIntosh C2500 amplifier (it should work with all rs232 McIntosh's) with Home Assistant using ESPHome.
# Filename: mcintosh.yaml
substitutions:
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"os" |
substitutions: | |
device_name: "saw-clamp" | |
friendly_name: "Saw AMP Clamp" | |
timezone: "Europe/London" | |
main_icon: "saw" | |
esphome: | |
name: ${device_name} | |
platform: ESP8266 | |
board: d1_mini |
#!/bin/bash | |
# Function to open an app if not already open | |
open_app() { | |
local app_id="$1" | |
local profile_dir="$2" | |
swaymsg -t get_tree | rg "$app_id-$profile_dir" > /dev/null || \ | |
chromium --app-id="$app_id" --profile-directory="$profile_dir" | |
} |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: cert-manager-webhook | |
namespace: kube-system | |
spec: | |
template: | |
spec: | |
containers: | |
- name: cert-manager-webhook |
// Alec Jacobson http://www.alecjacobson.com/weblog/?p=3816 | |
// clang -Wall -g -O3 -ObjC -framework Foundation -framework AppKit -o impbcopy impbcopy.m | |
#import <Foundation/Foundation.h> | |
#import <Cocoa/Cocoa.h> | |
#import <unistd.h> | |
BOOL copy_to_clipboard(NSString *path) | |
{ | |
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage | |
NSImage * image; |
substitutions: | |
device_name: mcintosh | |
friendly_name: "McIntosh C2500" | |
timezone: "Europe/London" | |
main_icon: "amp" | |
activity_threshold: "5" # Threshold (number) that the device will change from `Idle` to `Active` if power is greater than or equal to | |
esphome: | |
name: ${device_name} | |
platform: ESP8266 |
#!/bin/sh | |
# monitor asound status changes and trigger mqtt events | |
SND_STATUS="/proc/asound/card1/pcm0p/sub0/status" | |
MQTT_TOPIC="shellies/shelly1-xxxxx/relay/0/command" | |
MQTT_HOST="mqtt.home" | |
while true ; do | |
value=`cat $SND_STATUS | egrep 'state|closed'` |
# Roon manifest for k8s | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: roon | |
name: roon | |
namespace: home | |
annotations: |
#!/usr/bin/env python | |
# Sway fade effect for windows | |
# Credit https://www.reddit.com/r/swaywm/comments/e6ihm8/smooth_fading_in_sway/ | |
# /u/jake_is_a_legend | |
from i3ipc import Connection, Event | |
from threading import Thread | |
from time import sleep |