This file contains 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
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}); |
This file contains 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 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 |
This file contains 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
/* | |
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 |
This file contains 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 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'} |