Skip to content

Instantly share code, notes, and snippets.

@rdelcorro
rdelcorro / coronaserver.py
Created March 23, 2020 23:07
Corona parser
from http.server import HTTPServer, BaseHTTPRequestHandler
import requests
import json
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
headers = {'referer': 'https://www.arcgis.com/apps/opsdashboard/index.html'}
@rdelcorro
rdelcorro / main.cpp
Created December 23, 2019 19:05
TFT test code
/*
Sketch to generate the setup() calibration values, these are reported
to the Serial Monitor.
The sketch has been tested on the ESP8266 and screen with XPT2046 driver.
*/
#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library
@rdelcorro
rdelcorro / Dockerfile
Last active July 4, 2019 01:27
Dockerfile to embed tuyacontrol into a home assistant raspi image
FROM homeassistant/raspberrypi3-homeassistant:latest
RUN apk update && apk add nodejs git npm
RUN mkdir /tuyacontrol
ADD tuyacontrol.js /tuyacontrol/
RUN cd /tuyacontrol && npm install codetheweb/tuyapi
@rdelcorro
rdelcorro / tuyacontrol.js
Created July 4, 2019 01:24
Home assistant script to control tuya hardware locally
const TuyAPI = require('tuyapi');
var args = process.argv.slice(2);
app = function() {
const device = new TuyAPI({
ip: 'xx.xx.xx.xx',
id: 'xxxxx',
key: 'xxxxx',
version: 3.3});