added HA integration (not discovered)
This commit is contained in:
@@ -2,10 +2,20 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <WiFi.h>
|
||||
#include <Client.h>
|
||||
#include <ArduinoHA.h>
|
||||
|
||||
|
||||
#include "knob_data.h"
|
||||
#include "task.h"
|
||||
|
||||
#define BROKER_ADDR IPAddress(192,168,4,58)
|
||||
#define BROKER_USERNAME "mqtt_broker_user" // replace with your credentials
|
||||
#define BROKER_PASSWORD "mqtt2022"
|
||||
|
||||
//HA vars
|
||||
|
||||
|
||||
class CommuTask : public Task<CommuTask> {
|
||||
friend class Task<CommuTask>; // Allow base Task to invoke protected run()
|
||||
|
||||
@@ -13,13 +23,20 @@ class CommuTask : public Task<CommuTask> {
|
||||
CommuTask(const uint8_t task_core);
|
||||
~CommuTask();
|
||||
|
||||
void setAngleValue(uint32_t angle);
|
||||
QueueHandle_t getKnobStateQueue();
|
||||
|
||||
|
||||
protected:
|
||||
void run();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
uint32_t angle_ =0;
|
||||
SemaphoreHandle_t mutex_;
|
||||
|
||||
QueueHandle_t knob_state_queue_;
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user