8static constexpr uint32_t POWER_OFF_TIMEOUT_ID = 0;
24 " Time to enable: %" PRIu32
" ms\n"
25 " Keep on time: %" PRIu32
" s\n"
26 " Enable at startup: %s",
28 LOG_PIN(
" Pin: ", this->
pin_);
42 ESP_LOGV(TAG,
"Enabling");
51 ESP_LOGW(TAG,
"Invalid call to unrequest_high_power");
61 ESP_LOGV(TAG,
"Disabling");
bool cancel_timeout(const char *name)
Cancel a timeout function.
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
virtual void digital_write(bool value)=0
virtual bool is_internal()
Only the platform pin class behind the InternalGPIOPin alias may return true: callers static_cast to ...
virtual bool is_held() const
void dump_config() override
void request_high_power()
Request high power mode. Use unrequest_high_power() to remove this request.
void schedule_off_if_idle_()
void on_powerdown() override
bool is_enabled() const
Is this power supply currently on?
void unrequest_high_power()
Un-request high power mode.
void setup() override
Register callbacks.
float get_setup_priority() const override
Hardware setup priority (+1).
ESPHOME_LOG_TAG(TAG, "power_supply")
constexpr float POWER
For power supply components that must be on before buses like i2c can work.
constexpr float IO
For components that represent GPIO pins like PCF8573.
void HOT delay(uint32_t ms)