mirror of
https://github.com/esphome/esphome.git
synced 2025-09-24 06:02:21 +01:00
cleanup
This commit is contained in:
@@ -198,7 +198,6 @@ def test_device_with_invalid_area_id(
|
|||||||
|
|
||||||
# Check for the specific error message in stdout
|
# Check for the specific error message in stdout
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
print(captured.out)
|
|
||||||
assert (
|
assert (
|
||||||
"Couldn't find ID 'nonexistent_area'. Please check you have defined an ID with that name in your configuration."
|
"Couldn't find ID 'nonexistent_area'. Please check you have defined an ID with that name in your configuration."
|
||||||
in captured.out
|
in captured.out
|
||||||
|
@@ -259,8 +259,7 @@ def extract_object_id_from_expressions(expressions: list[str]) -> str | None:
|
|||||||
for expr in expressions:
|
for expr in expressions:
|
||||||
# Look for set_object_id calls with regex to handle various formats
|
# Look for set_object_id calls with regex to handle various formats
|
||||||
# Matches: var.set_object_id("temperature_2") or var.set_object_id('temperature_2')
|
# Matches: var.set_object_id("temperature_2") or var.set_object_id('temperature_2')
|
||||||
match = OBJECT_ID_PATTERN.search(expr)
|
if match := OBJECT_ID_PATTERN.search(expr):
|
||||||
if match:
|
|
||||||
return match.group(1)
|
return match.group(1)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user