Skip to content

Instantly share code, notes, and snippets.

View tedivm's full-sized avatar

Robert Hafner tedivm

View GitHub Profile
@tedivm
tedivm / robs_dimmer_blueprint.yaml
Created October 16, 2023 02:50
Home Assistant Dimmer Switch Blueprint
blueprint:
domain: automation
name: Rob's Dimmer Blueprint
description: Dimmer Controls
input:
controller_entity:
name: Philips Hue v2 Smart Dimmer Switch and Remote
description: The action sensor of the dimmer to use for the automation.
selector:
entity:
@tedivm
tedivm / makefile
Created April 11, 2024 21:00
Rob's Mermaid and Dot Diagrams Makefile
# Configuration
MAKEFLAGS += -j8
DOT_OPTIONS:=-Nfontname=arial -Efontname=arial -Gfontname=arial
MMD_OPTIONS:=-w 2000 -b transparent --cssFile ./mermaid_png.css --configFile ./mermaid_config.json
# Get all diagram files
MERMAID_FILES:=$(shell find . -name "*.mmd" -type f -not -path '*/build/*')
DOT_FILES:=$(shell find . -name "*.dot" -type f -not -path '*/build/*')
# Files that should be generated
@tedivm
tedivm / module_version.tf
Created April 23, 2024 19:16
Terraform Module Version from Inside Module
locals {
# Load the module versions from the modules.json file.
module_versions = jsondecode(file("${path.root}/.terraform/modules/modules.json"))
# Convert the module versions data into an object,
# with the module source path as key and version as value.
modules_by_source = { for module in local.module_versions :
module["Source"] => try(module["Version"], null)
}
@tedivm
tedivm / github_backup.sh
Last active November 24, 2024 05:19
Github Backups
#!/usr/bin/env bash
ORGANIZATIONS="tedivm tedious multi-py TerraformInDepth GitConsensus"
BACKUP_DIR="/storage-pool/github"
FLAGS="--source --no-archived"
GITHUB_PREFIX="https://github.com/"
# GITHUB_PREFIX="[email protected]:"
function repo_list() {
@tedivm
tedivm / esphome.yaml
Last active May 25, 2025 17:49
ESPHome ESP32-S3-Box-3 with Dock Voice Assistant
substitutions:
name: esp32-s3-box-3-99f810
friendly_name: ESP32 S3 Box 3 Office
micro_wake_word_model: hey_jarvis
packages:
esphome.voice-assistant: github://esphome/wake-word-voice-assistants/esp32-s3-box-3/esp32-s3-box-3.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
TofuPy is a wrapper around Terraform and OpenTofu. Please give it a full and detailed readme. You can find examples in the examples directory (pay attention to the python files more than anything), tests (which make for good usage examples) in the tests directory, and the primary library in the tofupy directory. Try to give a lot of examples of different actions people would do with terraform, but using TofuPy instead. Put a lot of effort into understanding the code as well. Assume the readers are familiar with terraform.