[components] Set optional plain values with cg.add_optional (a-m) (#21181)

This commit is contained in:
J. Nick Koston
2026-10-20 08:55:50 -04:00
committed by GitHub
parent 8b951fa620
commit a2fbedeac3
47 changed files with 115 additions and 227 deletions
+3 -3
View File
@@ -944,6 +944,7 @@ class TestEventSchema:
def mock_binary_sensor_codegen():
mock_var = MagicMock()
mock_parent = MagicMock()
mock_add = MagicMock()
with (
patch(
"esphome.components.motion.binary_sensor.cg.get_variable",
@@ -962,9 +963,8 @@ def mock_binary_sensor_codegen():
"esphome.components.motion.binary_sensor.cg.register_component",
new_callable=AsyncMock,
) as mock_reg_comp,
patch(
"esphome.components.motion.binary_sensor.cg.add",
) as mock_add,
patch("esphome.components.motion.binary_sensor.cg.add", mock_add),
patch("esphome.cpp_helpers.add", mock_add),
):
yield {
"get_variable": mock_get_var,