Filter discovery messages against HASS classes list (#1127)

* Filter the discovery message content against HASS list of classes
This commit is contained in:
Florian authored and GitHub committed 2022-01-11 20:24:09 -06:00
1 parent e6003c877c
commit 71d5622a52
2 files changed
+28 -2

No files matched your search

+17
View File
@@ -196,4 +196,21 @@ void announceDeviceTrigger(bool use_gateway_info,
# define stateClassTotalIncreasing "total_increasing"
#endif
// From https://github.com/home-assistant/core/blob/d7ac4bd65379e11461c7ce0893d3533d8d8b8cbf/homeassistant/const.py#L225
// List of classes available in Home Assistant
const char* availableHASSClasses[] = {"battery",
"carbon_monoxide",
"carbon_dioxide",
"humidity",
"illuminance",
"signal_strength",
"temperature",
"timestamp",
"pressure",
"power",
"current",
"energy",
"power_factor",
"voltage"};
#endif