Como a configuração é grande, recomendo que vc quebre ela em arquivos. para isto, crie 3 diretórios dentro da pasta de configuração do seu Home Assistant:
- switchs
- sensors
- light
| yarn global add json | |
| yarn add typescript @types/node ts-node | |
| yarn add -D prettier husky eslint rimraf \ | |
| eslint-config-prettier \ | |
| eslint-config-airbnb \ | |
| eslint-plugin-react \ | |
| eslint-plugin-prettier \ | |
| eslint-plugin-import \ |
| /** | |
| * Copyright (C) 2020 E01-AIO Automação Ltda. | |
| * | |
| * This program is free software: you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation, either version 3 of the License, or | |
| * (at your option) any later version. | |
| * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| /* | |
| TITLE: CODE GRABBER FOR HT6P20B ENCODER | |
| CREATED BY: AFONSO CELSO TURCATO | |
| DATE: 14/JAN/2014 | |
| E-MAIL: acturcato (at) gmail.com | |
| LICENSE: GPL | |
| REV.: 00 | |
| DESCRIÇÃO: | |
| http://acturcato.wordpress.com/2014/01/14/clonagem-de-controle-remoto-rf-learning-code-ht6p20b-com-arduino/ |
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]
| #include <ESP8266WiFi.h> | |
| #include <ESP8266mDNS.h> | |
| #include <WiFiUdp.h> | |
| #include <ArduinoOTA.h> | |
| const char* ssid = "NOME DA SUA REDE WIFI"; | |
| const char* password = "SENHA DA SUA REDE WIFI"; | |
| void setup() { | |
| Serial.begin(115200); |
| void i2c_scan() { | |
| byte error, address; | |
| int nDevices; | |
| Serial.println("Scanning..."); | |
| nDevices = 0; | |
| for(address = 1; address < 127; address++ ) | |
| { | |
| // The i2c_scanner uses the return value of |
| #include <FS.h> | |
| #include <ESP8266WiFi.h> | |
| #include <WiFiClientSecure.h> | |
| #include <PubSubClient.h> | |
| #include <time.h> | |
| // Insert your FQDN of your MQTT Broker | |
| #define MQTT_SERVER "mqtt.srvx1.local" | |
| const char* mqtt_server = MQTT_SERVER; |
| module.exports = { | |
| env: { | |
| es2021: true, | |
| node: true, | |
| jest: true, | |
| }, | |
| extends: ['airbnb-base', 'prettier'], | |
| parser: '@typescript-eslint/parser', | |
| parserOptions: { | |
| ecmaVersion: 12, |