This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gitea: | |
image: gitea/gitea:1.16.4 | |
container_name: gitea | |
environment: | |
- USER_UID=1000 | |
- USER_GID=1000 | |
- GITEA__database__DB_TYPE=postgres | |
- GITEA__database__HOST=giteadb:5432 | |
- GITEA__database__NAME=gitea | |
- GITEA__database__USER=gitea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import socket | |
from flask import Flask, render_template_string, request | |
from werkzeug.utils import secure_filename | |
app = Flask(__name__) | |
app.config["UPLOAD_FOLDER"] = "." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import PrettyPrinter | |
import requests | |
pp = PrettyPrinter() | |
def query(search) | |
url = f"https://wwwapi.lcsc.com/v1/search/global-search?keyword={search}" | |
r = requests.get(url) | |
pp.pprint(r.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------------------------------------------------------- | |
# Original code from the exccelent Mouse vs Python | |
# https://www.blog.pythonlibrary.org/2011/01/04/wxpython-wx-listctrl-tips-and-tricks/ | |
# -------------------------------------------------------------------------------------- | |
import re | |
import wx | |
import wx.lib.mixins.listctrl as listmix | |
import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
# https://www.solarmax.com/Downloads/MaxComm_Protokollbeschreibung_DE.pdf | |
# Communication | |
ip = "192.168.50.2" | |
port = 12345 | |
# inverters = ("01", "02", "03") | |
inverters = ("01",) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from datetime import datetime as dt | |
import cv2 | |
from PIL import Image, ImageDraw, ImageFont | |
BASEPATH = os.path.abspath(os.path.dirname(__file__)) | |
# read needle image as grayscale | |
template = cv2.imread(os.path.join(BASEPATH, "map.png"), 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.weber-marking.com/inkjet-printers/drop-on-demand-inkjet-printers/markoprint-x1jet.html | |
import serial | |
ESC = "\x1B" | |
CR = "\x0D" | |
STX = "\x02" | |
ETX = "\x03" | |
class X1Jet: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from luxtronik import Luxtronik | |
l = Luxtronik('192.168.88.11', 8889) | |
print("="*80) | |
print ('{:^80}'.format(' Parameters ')) | |
print("="*80) | |
for n, p in l.parameters.parameters.items(): | |
print(f"Number: {n:<5} Name: {p.name:<60} Type: {p.__class__.__name__:<20} Value: {p.value}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import logging | |
logging.basicConfig() | |
LOGGER = logging.getLogger() | |
LOGGER.setLevel(logging.INFO) | |
def discover(): | |
"""Broadcast discovery for luxtronik heatpumps.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Optional | |
from slugify import slugify | |
import time | |
import csv | |
from sqlmodel import Field, SQLModel, create_engine, Session, select | |
class Part(SQLModel, table=True): | |
id: Optional[int] = Field(default=None, primary_key=True) | |
lcsc_part: str | |
first_cat_id: Optional[int] = Field(default=None, foreign_key="firstcat.id") |