Add RTL_433 discovery with Home Assistant convention inspired from rtl_433_mqtt_hass.py (#1379)
This also changes the topic structure when using the macro valueAsATopic=true, it adds as sub-topics the `type, subtype, and channel` when they exist. The id is the last subtopic to facilitate filtering, as it may change when replacing the batteries. Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com>
This commit is contained in:
1 parent
ba70d364b1
commit
16815f51da
9 files changed
+389
-103
No files matched your search
@@ -47,7 +47,6 @@ QueueHandle_t BLEQueue;
|
||||
# include <esp_wifi.h>
|
||||
|
||||
# include <atomic>
|
||||
# include <vector>
|
||||
|
||||
# include "ZgatewayBLEConnect.h"
|
||||
# include "soc/timer_group_reg.h"
|
||||
@@ -58,12 +57,6 @@ using namespace std;
|
||||
// Global struct to store live BT configuration data
|
||||
BTConfig_s BTConfig;
|
||||
|
||||
# define device_flags_init 0 << 0
|
||||
# define device_flags_isDisc 1 << 0
|
||||
# define device_flags_isWhiteL 1 << 1
|
||||
# define device_flags_isBlackL 1 << 2
|
||||
# define device_flags_connect 1 << 3
|
||||
|
||||
TheengsDecoder decoder;
|
||||
|
||||
struct decompose {
|
||||
@@ -412,10 +405,6 @@ void createOrUpdateDevice(const char* mac, uint8_t flags, int model, int mac_typ
|
||||
xSemaphoreGive(semaphoreCreateOrUpdateDevice);
|
||||
}
|
||||
|
||||
# define isWhite(device) device->isWhtL
|
||||
# define isBlack(device) device->isBlkL
|
||||
# define isDiscovered(device) device->isDisc
|
||||
|
||||
void dumpDevices() {
|
||||
for (vector<BLEdevice*>::iterator it = devices.begin(); it != devices.end(); ++it) {
|
||||
BLEdevice* p = *it;
|
||||
|
||||
Reference in new issue
Block a user