Skip to content

Instantly share code, notes, and snippets.

View awstanley's full-sized avatar

A.W. Stanley awstanley

  • Sydney, Australia
View GitHub Profile
@awstanley
awstanley / svg_inject_test.html
Created September 26, 2020 12:29
Demonstration of SVG creation in JavaScript.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SVG Inject Test</title>
</head>
<body>
<script>
// Simple pathPath which is just a box with a point injected and raised. Nothing fancy!
let path = "M 3.9115288,12.97346 15.805024,2.3901266 27.698518,12.97346 V 33.152308 H 3.9115288 Z";
@awstanley
awstanley / zappi.txt
Last active April 26, 2022 23:18
Zappi integration tied Markdown display for your phone or dashboard. Designed for phone display or as part of a grid/horizontal grouping.
{# This Markdown will not execute anything on your Zappi, it just displays information.
Largely untested in different states due to the generally green nature of charging done here.
Pause state renders correctly against two inputs, and the Charging state works too.
* Required power/CT information is in watts (should be correct now);
* Session is in kWh (should be correct now);
* 'EV Connected' is clobbered by 'Charging', so state information is used from the integration.
Fixed an else/if issue and removed the untested Boost section.
@awstanley
awstanley / esphome-sphinx.py
Created August 9, 2022 09:16
Sphinx extension for ESPHome documentation.
"""
ESPHome Sphinx Extension.
This extension provides ESPHome documentation specific. While it may be a good starting
point for other projects, the esoteric nature of the included code is designed to assist
in automating the linking and indexing of components, devices, and blueprints.
Because Sphinx internals are foreign to most people looking through this, the documentation
in this file will verbose. (Future me thanks you for leaving them here too.)
@awstanley
awstanley / main.go
Last active April 23, 2025 22:45
ENode data to MQTT. Quick and dirty build being fleshed out to do more work via Home Assistant and other MQTT-linkable services. (I use localhost mqtt so this is missing some best-practices.)
package main
// TODO: individual vehicle by GUID (requires config update);
// TODO: non-vehicle support (I don't need this)
// TODO: Home Assistant add-on repository?
// TODO: Command-and-control interface
// TODO: vehicle refresh
// TODO: better rate control
// TODO: MQTTS mode (move functionality to library, build a proper package)