mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
[core] Const-ify some Component fields (#6831)
This commit is contained in:
parent
9de8eaff24
commit
63fc8ab10a
2 changed files with 6 additions and 6 deletions
|
@ -1,11 +1,11 @@
|
|||
#include "esphome/core/component.h"
|
||||
|
||||
#include <cinttypes>
|
||||
#include <utility>
|
||||
#include "esphome/core/application.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include <utility>
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome {
|
||||
|
||||
|
@ -140,8 +140,8 @@ void Component::set_retry(uint32_t initial_wait_time, uint8_t max_attempts, std:
|
|||
float backoff_increase_factor) { // NOLINT
|
||||
App.scheduler.set_retry(this, "", initial_wait_time, max_attempts, std::move(f), backoff_increase_factor);
|
||||
}
|
||||
bool Component::is_failed() { return (this->component_state_ & COMPONENT_STATE_MASK) == COMPONENT_STATE_FAILED; }
|
||||
bool Component::is_ready() {
|
||||
bool Component::is_failed() const { return (this->component_state_ & COMPONENT_STATE_MASK) == COMPONENT_STATE_FAILED; }
|
||||
bool Component::is_ready() const {
|
||||
return (this->component_state_ & COMPONENT_STATE_MASK) == COMPONENT_STATE_LOOP ||
|
||||
(this->component_state_ & COMPONENT_STATE_MASK) == COMPONENT_STATE_SETUP;
|
||||
}
|
||||
|
|
|
@ -118,9 +118,9 @@ class Component {
|
|||
*/
|
||||
virtual void mark_failed();
|
||||
|
||||
bool is_failed();
|
||||
bool is_failed() const;
|
||||
|
||||
bool is_ready();
|
||||
bool is_ready() const;
|
||||
|
||||
virtual bool can_proceed();
|
||||
|
||||
|
|
Loading…
Reference in a new issue