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
import nacl.utils | |
from nacl.public import PrivateKey, Box | |
from nacl.secret import SecretBox | |
import nacl.bindings | |
def generate_keypair(): | |
private_key = PrivateKey.generate() | |
public_key = private_key.public_key | |
return private_key, public_key |
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
#include "freeRTOS\freeRTOS.h" | |
#include "freeRTOS\task.h" | |
#include <ESP32Servo.h> | |
#define ENABLE_DEBUG | |
#ifdef ENABLE_DEBUG | |
#define DEBUG_ESP_PORT Serial | |
#define NODEBUG_WEBSOCKETS |
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
// #define ENABLE_DEBUG | |
#define SINRICPRO_NOSSL | |
#ifdef ENABLE_DEBUG | |
#define DEBUG_ESP_PORT Serial | |
#define NODEBUG_WEBSOCKETS | |
#define NDEBUG | |
#endif | |
#include <Arduino.h> |
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
#define ENABLE_DEBUG | |
#ifdef ENABLE_DEBUG | |
#define DEBUG_ESP_PORT Serial | |
#define NODEBUG_WEBSOCKETS | |
#define NDEBUG | |
#endif | |
#include <Arduino.h> | |
#if defined(ESP8266) |
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
{ | |
"name": "Water Level Indicator", | |
"description": "Water Level Indicator", | |
"deviceTypeId": "621b9648f728ec974aac62f2", | |
"capabilities": [ | |
{ | |
"id": "5ff0b45f994fd31b7d5e89c2", | |
"range": { | |
"instanceId": "rangeInstance1", | |
"locale": "en-US", |
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
//#define ENABLE_DEBUG | |
#ifdef ENABLE_DEBUG | |
#define DEBUG_ESP_PORT Serial | |
#define NODEBUG_WEBSOCKETS | |
#define NDEBUG | |
#endif | |
#include <Arduino.h> | |
#ifdef ESP8266 |
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
#define FOR_i(from, to) for(int i = (from); i < (to); i++) | |
FOR_i(1, 4) { | |
// do something | |
} |
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
#ifndef _GASSENSOR_H_ | |
#define _GASSENSOR_H_ | |
#include <SinricProDevice.h> | |
#include <Capabilities/ModeController.h> | |
#include <Capabilities/PushNotification.h> | |
class GasSensor | |
: public SinricProDevice | |
, public ModeController<GasSensor> |
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
{ | |
"name": "Gas Sensor", | |
"description": "Gas Sensor", | |
"deviceTypeId": "654d7ef928f14e9ac82ad57d", | |
"capabilities": [ | |
{ | |
"id": "5ff0b41b994fd31b7d5e8961", | |
"mode": { | |
"instanceId": "modeInstance1", | |
"locale": "en-US", |
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
#if defined(ESP8266) | |
const int adcPin = A0; | |
#elif defined(ESP32) | |
const int adcPin = 34; | |
#elif defined(ARDUINO_ARCH_RP2040) | |
const int adcPin = 26; | |
#endif | |
int sensorVal; |
NewerOlder