[core] Replace magic coroutine priority numbers with self-documenting CoroPriority enum (#10518)

This commit is contained in:
J. Nick Koston
2025-09-02 21:41:50 +00:00
committed by GitHub
parent f286bc57f3
commit d1276dc6df
57 changed files with 404 additions and 117 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ from esphome.const import (
CONF_TRIGGER_ID,
CONF_WEB_SERVER,
)
from esphome.core import CORE, coroutine_with_priority
from esphome.core import CORE, CoroPriority, coroutine_with_priority
from esphome.core.entity_helpers import entity_duplicate_validator, setup_entity
from esphome.cpp_generator import MockObjClass
@@ -155,6 +155,6 @@ async def lock_is_off_to_code(config, condition_id, template_arg, args):
return cg.new_Pvariable(condition_id, template_arg, paren, False)
@coroutine_with_priority(100.0)
@coroutine_with_priority(CoroPriority.CORE)
async def to_code(config):
cg.add_global(lock_ns.using)