|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Dimmable light for a heater's night light (night_light: on a heater with io_model heater_with_light). More...
#include <platform_climate_controls.h>
Public Member Functions | |
| void | setup () override |
| Subscribe to the device's updates and publish what is already known. | |
| void | dump_config () override |
| Dump light configuration to the log. | |
| float | get_setup_priority () const override |
| Get setup priority so the parent hub is available first. | |
| light::LightTraits | get_traits () override |
| Brightness is the light's only colour mode. | |
| void | setup_state (light::LightState *state) override |
| Store the LightState and swallow the write its restore_mode makes at boot. | |
| void | write_state (light::LightState *state) override |
| Send the requested state to the heater and read it back. | |
| Public Member Functions inherited from esphome::home_io_control::DeviceBoundCompanion | |
| void | set_parent (IOHomeControlComponent *parent) |
| Set the parent controller component. | |
| void | set_device_id (const std::string &id) |
| Set the device ID whose state this companion sensor exposes. | |
Protected Member Functions | |
| void | on_device_update_ (const IoDevice &dev) |
| Publish the heater's light state, without echoing it back as a write. | |
| bool | write_register_ (HeatingFunction fn, float value) |
| Write one light register. | |
| Protected Member Functions inherited from esphome::home_io_control::DeviceBoundCompanion | |
| void | register_companion_binding_ (const std::function< void(const IoDevice &)> &publish) |
| Shared setup() body: subscribe to this device's updates and publish the initial state. | |
Protected Attributes | |
| light::LightState * | state_ {nullptr} |
| bool | suppress_write_ {false} |
| Swallows the write_state() that LightState::make_call().perform() causes for a state this entity publishes itself (and the boot-time restore, see setup_state()). | |
| bool | writing_ {false} |
| True while write_state() runs its writes and read-backs: the device updates they cause are not published one by one (a half-updated reading would flash a stale brightness), but once at the end. | |
| Protected Attributes inherited from esphome::home_io_control::DeviceBoundCompanion | |
| IOHomeControlComponent * | parent_ {nullptr} |
| std::string | device_id_ |
Dimmable light for a heater's night light (night_light: on a heater with io_model heater_with_light).
On/off is register 0x0144 and the brightness register 0x0142, a percentage that maps 1:1 onto Home Assistant's brightness (100 % = full). The light shows what the heater reports: no state until the first poll has read 0x0144, every acknowledged write is read back, and a write the heater does not acknowledge leaves the light showing the heater's last reading.
Switching on writes the brightness only when it differs from what the heater holds, then the on/off register; so on/off at an unchanged brightness never depends on the brightness write.
Definition at line 88 of file platform_climate_controls.h.
|
override |
Dump light configuration to the log.
Definition at line 136 of file platform_climate_controls.cpp.
|
inlinenodiscardoverride |
Get setup priority so the parent hub is available first.
Definition at line 98 of file platform_climate_controls.h.
|
override |
Brightness is the light's only colour mode.
Definition at line 72 of file platform_climate_controls.cpp.
|
protected |
Publish the heater's light state, without echoing it back as a write.
| dev | The device record. |
Definition at line 78 of file platform_climate_controls.cpp.
|
override |
Subscribe to the device's updates and publish what is already known.
Definition at line 68 of file platform_climate_controls.cpp.
|
inlineoverride |
Store the LightState and swallow the write its restore_mode makes at boot.
LightState::setup() applies its restore_mode through a real write_state() right after this call; on a radio-controlled light that would switch the heater's light at every reboot. The poll is the source of truth, so that one write is suppressed.
| state | The LightState this output belongs to. |
Definition at line 110 of file platform_climate_controls.h.
|
protected |
Write one light register.
| fn | NIGHT_LIGHT or NIGHT_LIGHT_BRIGHTNESS. |
| value | Value to write. |
Definition at line 92 of file platform_climate_controls.cpp.
|
override |
Send the requested state to the heater and read it back.
| state | The LightState holding the requested values. |
Definition at line 100 of file platform_climate_controls.cpp.
|
protected |
Definition at line 130 of file platform_climate_controls.h.
|
protected |
Swallows the write_state() that LightState::make_call().perform() causes for a state this entity publishes itself (and the boot-time restore, see setup_state()).
Definition at line 133 of file platform_climate_controls.h.
|
protected |
True while write_state() runs its writes and read-backs: the device updates they cause are not published one by one (a half-updated reading would flash a stale brightness), but once at the end.
Definition at line 136 of file platform_climate_controls.h.