6#include "esphome/core/log.h"
11static const char *
const TAG =
"home_io_control.light";
20 this->
parent_->register_device_callback(
29 auto traits = light::LightTraits();
31 traits.set_supported_color_modes({light::ColorMode::ON_OFF});
37 state->current_values_as_binary(&on);
59 if (this->
state_->current_values.is_on() == on && this->state_->remote_values.is_on() == on)
64 auto call = this->
state_->make_call();
71 ESP_LOGCONFIG(
TAG,
"IO-Homecontrol Binary Light");
72 ESP_LOGCONFIG(
TAG,
" Device ID: %s", this->
device_id_.c_str());
74 ESP_LOGCONFIG(
TAG,
" Status Poll Interval: default single settle poll");
78 ESP_LOGCONFIG(
TAG,
" Status: experimental and untested");
IOHomeControlComponent * parent_
void write_state(light::LightState *state) override
bool suppress_write_
Guard so that an inbound radio status does not echo back as a new outbound command.
light::LightState * state_
void on_device_update_(const std::string &id, const IoDevice &dev)
Handle inbound device status updates.
uint32_t status_poll_interval_ms_
void dump_config() override
Dump configuration to log.
light::LightTraits get_traits() override
Return traits: binary on/off only (no dimming).
void setup() override
Initialize the light entity.
Internal helpers shared by the hub implementation .cpp files.
constexpr uint32_t INITIAL_STATUS_REQUEST_DELAY_MS
Delay before the first post-boot status request from an entity.
constexpr float BINARY_ENTITY_ON_POSITION_THRESHOLD
Shared 0-100 cutoff: values below this mean binary "on".
static constexpr float UNKNOWN_POSITION
Sentinel value meaning "position is not known yet".
static const char *const TAG
Runtime state of a paired IO‑Homecontrol device.
float position
Current position: 0=open, 100=closed, or UNKNOWN_POSITION.
bool is_stopped
True if device is not moving.