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
| blueprint: | |
| name: ZHA - Tuya Smart Knob for lights - v1.2 | |
| description: 'Control lights with a Tuya Smart Knob from "_TZ3000_402vrq2i". | |
| Tapping activates toggle event and will toggle the selected light. | |
| Rotating left/right will change the brightness smoothly of the selected light. | |
| Adjusted for generic Tuya Smart Knob, with functionality added for remote mode. | |
| Device is switched to remote mode, and back, by rapidly tapping 3 times. | |
| Once in remote mode the following functions are available | |
| - Short Press |
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
| #! /usr/bin/env python3 | |
| # -*- coding: UTF-8 -*- | |
| """NOTES | |
| starting point was this code: | |
| [OWON OW18E on Python · Issue #4 · sercona/Owon-Multimeters](https://github.com/sercona/Owon-Multimeters/issues/4) | |
| which is a partial port of older C code: | |
| https://github.com/sercona/Owon-Multimeters/blob/main/owon_multi_cli.c | |
| - there is no code to switch modes on the meter like the ISMART software does |
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 cv2 | |
| import numpy as np | |
| ''' | |
| with info from , check out: | |
| https://www.eevblog.com/forum/thermal-imaging/infiray-and-their-p2-pro-discussion/200/ | |
| https://github.com/leswright1977/PyThermalCamera/blob/main/src/tc001v4.2.py | |
| I did create a seperate conda env for this project on Windows: | |
| conda create -n p2pro python |
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 cv2 | |
| import numpy as np | |
| ''' | |
| with info from , check out: | |
| https://www.eevblog.com/forum/thermal-imaging/infiray-and-their-p2-pro-discussion/200/ | |
| https://github.com/leswright1977/PyThermalCamera/blob/main/src/tc001v4.2.py | |
| I did create a seperate conda env for this project on Windows: | |
| conda create -n p2pro python |
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 time | |
| import machine | |
| import math | |
| class MAX31865(): | |
| def __init__(self, | |
| spi, | |
| cs, |
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 streamlit as st | |
| class pageswitcher: | |
| def __init__(self,page=None): | |
| ''' streamit (V>=4.8) usage:\n | |
| A browser page corresponds to streamlit code inside a function\n | |
| With .setpage() you can register a function (page) to be run on the next restart\n | |
| With run(page) you can set a function and restart or restart with the last set page (run())\n | |
| Each page function should return with runcaller() to its calling page\n | |
| The first 2 code linses in the main script should be like this (with main() beeing the main page/function):\n |
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 streamlit as st | |
| import asyncio | |
| import math | |
| from random import random | |
| from collections import deque | |
| def red_green(red:bool): | |
| if red: return '🔴' | |
| else : return '🟢' |