mirror of
https://github.com/esphome/esphome.git
synced 2026-09-25 14:00:25 +00:00
[core] Pack entity flags into configure_entity_() and protect setters (#14564)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9547a54fac
commit
d0285cdc41
@@ -1,4 +1,6 @@
|
||||
"""Tests for the binary sensor component."""
|
||||
"""Tests for the text component."""
|
||||
|
||||
from tests.component_tests.helpers import INTERNAL_BIT, extract_packed_value
|
||||
|
||||
|
||||
def test_text_is_setup(generate_main):
|
||||
@@ -37,9 +39,9 @@ def test_text_config_value_internal_set(generate_main):
|
||||
# When
|
||||
main_cpp = generate_main("tests/component_tests/text/test_text.yaml")
|
||||
|
||||
# Then
|
||||
assert "it_2->set_internal(false);" in main_cpp
|
||||
assert "it_3->set_internal(true);" in main_cpp
|
||||
# Then: it_2 has internal: false, it_3 has internal: true
|
||||
assert extract_packed_value(main_cpp, "it_2") & INTERNAL_BIT == 0
|
||||
assert extract_packed_value(main_cpp, "it_3") & INTERNAL_BIT != 0
|
||||
|
||||
|
||||
def test_text_config_value_mode_set(generate_main):
|
||||
|
||||
Reference in New Issue
Block a user