From d355fecbaa3769e42e07b6bf830d961c86ab6e8a Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Fri, 9 Aug 2024 17:41:03 +0200 Subject: [PATCH] fix lint --- esphome/components/media_player/automation.h | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/esphome/components/media_player/automation.h b/esphome/components/media_player/automation.h index c808832fdd..d67af298ea 100644 --- a/esphome/components/media_player/automation.h +++ b/esphome/components/media_player/automation.h @@ -9,7 +9,7 @@ namespace media_player { #define MEDIA_PLAYER_SIMPLE_COMMAND_ACTION(ACTION_CLASS, ACTION_COMMAND) \ template \ - class(ACTION_CLASS) \ + class ACTION_CLASS /* NOLINT(bugprone-macro-parentheses)*/ \ : public Action, \ public Parented{ \ void play(Ts... x) override{this->parent_->make_call() \ @@ -20,15 +20,16 @@ namespace media_player { ; #define MEDIA_PLAYER_SIMPLE_STATE_TRIGGER(TRIGGER_CLASS, TRIGGER_STATE) \ - class(TRIGGER_CLASS) \ - : public Trigger<>{ \ - public: explicit TRIGGER_CLASS(MediaPlayer * player){player->add_on_state_callback([this, player]() { \ - if (player->state == MediaPlayerState::MEDIA_PLAYER_STATE_##TRIGGER_STATE) \ - this->trigger(); \ - }); \ - } \ - } \ - ; + class TRIGGER_CLASS /* NOLINT(bugprone-macro-parentheses)*/ \ + : public Trigger<> { \ + public: \ + explicit TRIGGER_CLASS(MediaPlayer *player) { \ + player->add_on_state_callback([this, player]() { \ + if (player->state == MediaPlayerState::MEDIA_PLAYER_STATE_##TRIGGER_STATE) \ + this->trigger(); \ + }); \ + } \ + }; MEDIA_PLAYER_SIMPLE_COMMAND_ACTION(PlayAction, PLAY) MEDIA_PLAYER_SIMPLE_COMMAND_ACTION(PauseAction, PAUSE)