This commit is contained in:
2020-07-09 19:51:49 +02:00
8 changed files with 248 additions and 4 deletions

View File

@ -53,4 +53,5 @@ public:
void blur_row(uint8_t y, fract8 intensity);
void blur_columns(fract8 intensity);
void blur_column(uint8_t x, fract8 intensity);
void fill_with_checkerboard();
};

View File

@ -37,6 +37,7 @@
#define MQTT_REPORT_METRICS // Whether to report metrics via MQTT. Disable if unwanted.
#define MQTT_TOPIC_WEATHER "accuweather/pitrix/" // MQTT topic to listen for weather data. Must not start with a slash, but must end with one.
#define MQTT_TOPIC_TIMER "alexa/timer"
#define MQTT_TOPIC_HOMEASSISTANT "homeassistant"
#define HOSTNAME "pitrix-%08X" // Hostname of the ESP to use for OTA and MQTT client id. %08X will be replaced by the chip id.
#define OTA_STARTUP_DELAY 10 // How many seconds to wait at startup. This is useful to prevent being unable to flash OTA by a bug in the code. Set to 0 to disable.

30
include/effect_tpm2_net.h Normal file
View File

@ -0,0 +1,30 @@
#pragma once
#include "Effect.h"
#include "prototypes.h"
#include "my_fastled.h"
#include "Window.h"
#include "config.h"
#include <WiFiUdp.h>
class Tpm2NetEffect : public Effect {
protected:
Window* window = &Window::window_full;
WiFiUDP _udp;
uint16_t _pixel_index = 0;
void _parse_command(uint16_t size, uint8_t packet_number);
void _parse_data(uint16_t size, uint8_t packet_number);
void _respond(uint8_t* data, uint8_t len);
void _respond_ack();
void _respond_with_data(uint8_t* data, uint8_t len);
void _respond_unknown_command();
unsigned long _last_packet_at = 0;
public:
Tpm2NetEffect();
virtual ~Tpm2NetEffect();
virtual void loop(uint16_t ms);
bool can_be_shown_with_clock();
String get_name() override { return "tpm2.net"; }
};