mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 19:06:37 +00:00
Derive entity category names from cv.ENTITY_CATEGORIES and cleanup
- Remove hardcoded _ENTITY_CATEGORY_NAMES dict, derive from cv.ENTITY_CATEGORIES keys - Remove redundant local import re (already at top level) - Remove last setup_test_environment noqa line
This commit is contained in:
@@ -942,7 +942,6 @@ async def test_setup_entity_with_entity_category(
|
||||
setup_test_environment: list[str],
|
||||
) -> None:
|
||||
"""Test setup_entity sets entity_category correctly."""
|
||||
setup_test_environment # noqa: F841 - fixture initializes CORE state
|
||||
var = MockObj("sensor1")
|
||||
config = {
|
||||
CONF_NAME: "Temperature",
|
||||
@@ -1008,8 +1007,6 @@ async def test_setup_entity_decorator_mode(setup_test_environment: list[str]) ->
|
||||
|
||||
def _extract_packed_value(expressions: list[str]) -> int:
|
||||
"""Extract the third argument (packed value) from a configure_entity_() call."""
|
||||
import re
|
||||
|
||||
for expr in expressions:
|
||||
if "configure_entity_" in expr:
|
||||
# Match the last integer argument before the closing ");"
|
||||
|
||||
Reference in New Issue
Block a user