mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
Please ad "ENTITIES" like on dashboard within api call ems/api/system per device #322
This commit is contained in:
@@ -1174,9 +1174,10 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
|
|||||||
for (const auto & device_class : EMSFactory::device_handlers()) {
|
for (const auto & device_class : EMSFactory::device_handlers()) {
|
||||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||||
if ((emsdevice) && (emsdevice->device_type() == device_class.first)) {
|
if ((emsdevice) && (emsdevice->device_type() == device_class.first)) {
|
||||||
JsonObject obj = devices.createNestedObject();
|
JsonObject obj = devices.createNestedObject();
|
||||||
obj["type"] = emsdevice->device_type_name();
|
obj["type"] = emsdevice->device_type_name();
|
||||||
obj["name"] = emsdevice->to_string();
|
obj["name"] = emsdevice->to_string();
|
||||||
|
obj["entities"] = emsdevice->count_entities();
|
||||||
char result[200];
|
char result[200];
|
||||||
(void)emsdevice->show_telegram_handlers(result, EMSdevice::Handlers::RECEIVED);
|
(void)emsdevice->show_telegram_handlers(result, EMSdevice::Handlers::RECEIVED);
|
||||||
if (result[0] != '\0') {
|
if (result[0] != '\0') {
|
||||||
|
|||||||
Reference in New Issue
Block a user