Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automation.h wrong return types in functions #5385

Closed
latonita opened this issue Jan 15, 2024 · 1 comment · Fixed by esphome/esphome#6760
Closed

automation.h wrong return types in functions #5385

latonita opened this issue Jan 15, 2024 · 1 comment · Fixed by esphome/esphome#6760
Labels

Comments

@latonita
Copy link

latonita commented Jan 15, 2024

The problem

There are two particular places with wrong return value types:
1.[FIXED ALREADY] boolean returned instead of integer. shall be return 0 i suppose.

/// Return the number of actions in this action list that are currently running.
  int num_running() {
    if (this->actions_begin_ == nullptr)
      return false;
    return this->actions_begin_->num_running_total();
  }
  1. Another questionable place where function add_action returns nothing instead of the pointer
template<typename... Ts> class Automation {
...
Action<Ts...> *add_action(Action<Ts...> *action) { this->actions_.add_action(action); }

Which version of ESPHome has the issue?

2023.12.xx

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

No response

Component causing the issue

No response

Example YAML snippet

n/a

Anything in the logs that might be useful for us?

n/a

Additional information

No response

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant