ESPHome, UART Bus number from pzemac.cpp

Hello!

A question about diagnostics of the UART Bus number in /esphome/components/pzemac/pzemac.cpp.

I add to the code:

#ifdef USE_LOGGER
#include "esphome/components/logger/logger.h"
#endif

then I add diagnostics:
ESP_LOGCONFIG(TAG, "UART Bus %d", logger::global_logger->get_uart());

But instead of the real number 0 in my configuration, I get 2.

[21:47:40][C][uart.arduino_esp32:151]: UART Bus 0
...
[21:47:45][C][pzemac:058]: UART Bus 2

Please tell me how to display the UART Bus number in the pzemac.cpp code?

With best regards!

I’m not familiar with pzemac.cpp and likely many of us are not, so can you tell what are you trying to accomplish? Maybe there are multiple ways…