[switch] Inline the trivial inverted accessors

This commit is contained in:
J. Nick Koston
2026-08-22 01:02:19 -05:00
parent ef1d77885d
commit 32081a0e29
2 changed files with 2 additions and 5 deletions
-3
View File
@@ -69,9 +69,6 @@ void Switch::publish_state(bool state) {
}
bool Switch::assumed_state() { return false; }
void Switch::set_inverted(bool inverted) { this->inverted_ = inverted; }
bool Switch::is_inverted() const { return this->inverted_; }
void log_switch(const char *tag, const char *prefix, const char *type, Switch *obj) {
if (obj != nullptr) {
// Prepare restore mode string
+2 -2
View File
@@ -87,7 +87,7 @@ class Switch : public EntityBase {
*
* @param inverted Whether to invert this switch.
*/
void set_inverted(bool inverted);
void set_inverted(bool inverted) { this->inverted_ = inverted; }
/** Set callback for state changes.
*
@@ -117,7 +117,7 @@ class Switch : public EntityBase {
*/
virtual bool assumed_state();
bool is_inverted() const;
bool is_inverted() const { return this->inverted_; }
void set_restore_mode(SwitchRestoreMode restore_mode) { this->restore_mode = restore_mode; }