Skip to content

Commit 54488a4

Browse files
committed
Dev update: Device ID to string
Implemented easy transfer from device it to Device type (0x0000 = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID -> "General On/Off switch".
1 parent 14b99db commit 54488a4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

libraries/Zigbee/src/Zigbee_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ bool Zigbee_Core::zigbeeInit(esp_zb_cfg_t *zb_cfg, bool erase_nvs) {
101101
//print the list of Zigbee EPs from ep_objects
102102
log_i("List of registered Zigbee EPs:");
103103
for (std::list<Zigbee_EP*>::iterator it = ep_objects.begin(); it != ep_objects.end(); ++it) {
104-
log_i("Endpoint: %d, Device ID: 0x%04x", (*it)->_endpoint, (*it)->_device_id); //TODO: Idea device id -> device name
104+
log_i("Device type: %s, Endpoint: %d, Device ID: 0x%04x", getDeviceTypeString((*it)->_device_id), (*it)->_endpoint, (*it)->_device_id);
105105
}
106106

107107
// Register Zigbee action handler

libraries/Zigbee/src/Zigbee_core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class Zigbee_Core {
110110
void setRebootOpenNetwork(uint8_t time);
111111

112112
void factoryReset();
113+
114+
const char* getDeviceTypeString(esp_zb_ha_standard_devices_t deviceId);
113115
};
114116

115117
extern Zigbee_Core Zigbee;

0 commit comments

Comments
 (0)