Skip to content

Instantly share code, notes, and snippets.

View Staars's full-sized avatar

Christian Baars Staars

View GitHub Profile
@Staars
Staars / weather_dash.be
Created October 7, 2025 19:55
variant 1
class WEATHER_DASHBOARD : Driver
var weather_data
var forecast_data
var widget_rotation
var last_update
var widget_content # Global class var to hold widget string
def init()
self.weather_data = nil
self.forecast_data = nil
@Staars
Staars / csi_dashboard.be
Last active October 7, 2025 12:55
CSI via Dashboard
class CSI_VISUALIZER : Driver
var csi_started, type
var packet_count
var stats
var data_buffers
var update_index
var widget_content # Global class var to hold widget string
var current_values
static BUFFER_SIZE = 100
@Staars
Staars / csi.be
Last active October 7, 2025 12:54
csi tests
class CSI_Driver
var csi_started, type
var packet_count
var stats
def init()
self.csi_started = false
self.packet_count = 0
self.stats = {'raw': 0, 'light': 0, 'unknown': 0, 'errors': 0}
tasmota.add_driver(self)
@Staars
Staars / multigraph.be
Last active October 2, 2025 04:52
next demo
#################################################################################
# Multi Graph Widget Demo - 8 different graph types (No AJAX)
#################################################################################
class MULTI_GRAPH_WIDGET : Driver
var data_buffers
var update_index
var pending_widget
var gauge_value
var gauge_dir
@Staars
Staars / widget_graph.be
Last active September 29, 2025 19:36
just a demo
#################################################################################
# Demo Graph Widget - Using built-in graph with AJAX updates
#################################################################################
class DEMO_GRAPH_WIDGET : Driver
var initialized
var data_buffer
static BUFFER_SIZE = 64
def init()
import MI32
@Staars
Staars / scan_widget.be
Created September 28, 2025 19:09
new widget scanner
#################################################################################
# MI32 Widget for the BLE scanner
#################################################################################
class SCAN_WIDGET : Driver
var buf
var scan_timer, scan_result, active_scan
var update_table, stop_scan
var init_step, ble_down
@Staars
Staars / update_static_page.py
Last active October 1, 2025 17:10
make BROTLI in file
#!/usr/bin/env python3
import gzip, sys, re, textwrap
from pathlib import Path
import htmlmin, rcssmin, rjsmin, brotli
OPEN_PATTERN = re.compile(r"/\*\s*STATIC_(\w+)\s+([A-Za-z_]\w*)\s*\n", re.S)
STYLE_RE = re.compile(r"(<style[^>]*>)(.*?)(</style>)", re.S|re.I)
SCRIPT_RE = re.compile(r"(<script[^>]*>)(.*?)(</script>)", re.S|re.I)
/*
xdrv_52_3_tf_lite_micro.ino - Berry scripting language, High-Level Tensor Flow Lite for Microprocessors model deployer
Now with CSI (Channel State Information) support
Copyright (C) 2022 Christian Baars & Stephan Hadinger, Berry language by Guan Wenliang https://github.com/Skiars/berry
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@Staars
Staars / test.be
Last active September 18, 2025 14:56
Matrix tests
# === Setup ===
leds = Leds(8 * 32, gpio.pin(gpio.WS2812, 0))
buf = leds.pixels_buffer()
m = Matrix(buf, 32, 8, 3, true) # serpentine = true
# === Helper: show and pause ===
def show_pause(ms)
leds.show()
tasmota.delay(ms)
end
@Staars
Staars / ed25519.h
Created September 14, 2025 15:53
Save 31,5 kB flash
/*
D. J. Bernstein
Public domain.
*/
#ifndef TASMOTA_ED25519_H
#define TASMOTA_ED25519_H
typedef int32_t fe[10];