mirror of
https://github.com/esphome/esphome.git
synced 2024-12-01 11:14:13 +01:00
Fix linting issues
This commit is contained in:
parent
0a4aad9eb0
commit
c3d5b7803d
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue