mirror of
https://github.com/esphome/esphome.git
synced 2026-03-27 10:41:32 +08:00
91944988ef55fdc574b7e0f978f65494180ea5a4
Replace optional<T> state_ in StatefulEntityBase with pure virtual get_state()/set_state_value_() that subclasses implement. BinarySensor stores its value in the existing public bool state member and uses EntityBase::flags_.has_state instead of the optional's discriminant. Move trigger_on_initial_state_ into EntityBase::flags_ (1 bit from reserved), eliminating the standalone bool and its padding. Saves 8 bytes per BinarySensor instance: - optional<bool> (2B) + padding (2B) = 4B removed - bool trigger_on_initial_state_ (1B) + padding (3B) = 4B removed
…
…
…
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
632 MiB
Languages
C++
63.3%
Python
36.3%
C
0.3%
