Fix linting issues

This commit is contained in:
Rapsssito 2024-07-13 11:00:35 +02:00
parent 0a4aad9eb0
commit c3d5b7803d
2 changed files with 4 additions and 4 deletions

View file

@ -5,8 +5,8 @@ namespace esphome {
static const char *const TAG = "event_emitter"; static const char *const TAG = "event_emitter";
void RaiseEventEmitterFullError(EventEmitterListenerID id) { void RaiseEventEmitterFullError(EventEmitterListenerID id) {
ESP_LOGE(TAG, "EventEmitter has reached the maximum number of listeners for event"); ESP_LOGE(TAG, "EventEmitter has reached the maximum number of listeners for event");
ESP_LOGW(TAG, "Removing listener with ID %d to make space for new listener", id); ESP_LOGW(TAG, "Removing listener with ID %ld to make space for new listener", id);
} }
} // namespace esphome } // namespace esphome

View file

@ -11,8 +11,8 @@ namespace esphome {
using EventEmitterListenerID = uint32_t; using EventEmitterListenerID = uint32_t;
void RaiseEventEmitterFullError(EventEmitterListenerID id); void RaiseEventEmitterFullError(EventEmitterListenerID id);
// EventEmitter class that can emit events with a specific name (it is highly recommended to use an enum class for this) and a list of arguments. // EventEmitter class that can emit events with a specific name (it is highly recommended to use an enum class for this)
// Supports multiple listeners for each event. // and a list of arguments. Supports multiple listeners for each event.
template<typename EvtType, typename... Args> class EventEmitter { template<typename EvtType, typename... Args> class EventEmitter {
public: public:
EventEmitterListenerID on(EvtType event, std::function<void(Args...)> listener) { EventEmitterListenerID on(EvtType event, std::function<void(Args...)> listener) {