Skip to content

Instantly share code, notes, and snippets.

View Staars's full-sized avatar

Christian Baars Staars

View GitHub Profile
@Staars
Staars / appload.be
Last active December 27, 2023 10:18
Berry app loader example
class APPLOAD
static base_url = 'https://raw.githubusercontent.com/Hypfer/ulanzi-tc001-tasmota/master/berry/'
static f_list =[
"BEDClockFace.be","BaseClockFace.be","BasicClockFace.be","BatteryClockFace.be","ClockfaceManager.be",
"DateClockFace.be","MatrixController.be","NetClockFace.be","SecondsClockFace.be","SensorClockFace.be",
"SolarClockFace.be","autoexec.be","fonts.be","util.be"
]
static def download_file(file_name, url)
var cl = webclient()
@Staars
Staars / bot.be
Last active November 11, 2023 16:32
Fingerbot
# BLE Tuya FingerBot controller
# proof of concept from https://github.com/redphx/poc-tuya-ble-fingerbot
import BLE
# "enums"
class Coder
static FUN_SENDER_DEVICE_INFO = 0
static FUN_SENDER_PAIR = 1
static FUN_SENDER_DPS = 2
@Staars
Staars / index.html
Last active October 20, 2023 12:54
dashboard test
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="description" content="Webpage description goes here" />
<meta charset="utf-8">
<title>Dashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="">
</head>
@Staars
Staars / audio.be
Last active September 16, 2023 10:53
test audio berry
def read_cfg()
var b = open("/.drvset042").readbytes()
var cfg = {}
print("Did load settings in /.drvset042 with size:", size(b))
print(b)
cfg["version"] = b.get(0,4)
var t = b.get(4,1)
var tx = {}
tx["mode"] = t & 3
tx["apll"] = (t >> 2) & 1
@Staars
Staars / pages.jsonl
Created August 28, 2023 18:27
twatch_haspmota demo
{"page":0,"comment":"---------- Upper stat line ----------"}
{"id":0,"text_color":"#FFFFFF"}
{"id":11,"obj":"label","x":0,"y":0,"w":240,"pad_right":90,"h":22,"bg_color":"#D00000","bg_opa":255,"radius":0,"border_side":0,"text":"Tasmota","text_font":"montserrat-20"}
{"id":15,"obj":"lv_wifi_arcs","x":211,"y":0,"w":29,"h":22,"radius":0,"border_side":0,"bg_color":"#000000","line_color":"#FFFFFF"}
{"id":16,"obj":"lv_clock","x":222,"y":3,"w":55,"h":16,"radius":0,"border_side":0}
{"comment":"---------- Bottom buttons - prev/home/next ----------"}
{"id":101,"obj":"btn","x":10,"y":210,"w":50,"h":25,"action":"prev","bg_color":"#1fa3ec","radius":10,"border_side":1,"text":"\uF053","text_font":"montserrat-20"}
{"id":102,"obj":"btn","x":95,"y":210,"w":50,"h":25,"action":"back","bg_color":"#1fa3ec","radius":10,"border_side":1,"text":"\uF015","text_font":"montserrat-20"}
@Staars
Staars / widget_test.dart
Created July 13, 2023 13:10
Flutter test
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:intl/intl.dart' as intl;
class deviceInfo extends StatelessWidget {
@Staars
Staars / genManifests.py
Created May 24, 2023 19:05
Version with driver feature generation
#!/usr/bin/python3
from platform import release
import sys
from os import listdir
from os import mkdir
from os import remove
from os import path
import json
import requests
@Staars
Staars / test.html
Created March 16, 2023 16:39
just a test
<!DOCTYPE html>
<html lang="en" class="">
<head>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
<title>Install Tasmota</title>
<style>
div,fieldset,input,select{padding:5px;font-size:1em;}
fieldset{background:#4f4f4f;}
p{margin:0.5em 0;}
@Staars
Staars / mdcc.be
Created March 5, 2023 13:20
Tasmota TFL Speech example
class MICROSPEECH : Driver
var o # output tensor
var model # this var really holds the model data for the entire session
var out_buf, out_buf_idx
var average
var time_out
def init()
import TFL
var outputs = 5 # this value must be taken from the model
@Staars
Staars / command_chain.be
Last active March 5, 2023 13:19
Test snippet for Tasmotas speech recognition
# globals
var key_words = ["color", "computer", "higher", "illuminance", "led", "lower", "make it so", "noise", "unknown"] # must match your trained model!!
var thresholds = [730,700,680,750,650,755,580,650,650] # same indices as key_words, increase against false positives, decrease against misses
class COMMAND_CHAIN
var next_step
var hue_old, bri_old
def init()
self.next_step = /c->self.step_one(c)