1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-23 20:23:50 +01:00

suggestions

This commit is contained in:
J. Nick Koston
2025-10-18 21:57:19 -10:00
parent acdecafeef
commit 70479dec0d
2 changed files with 3 additions and 8 deletions

View File

@@ -116,8 +116,7 @@ template<typename... Ts> class QueueingScript : public Script<Ts...>, public Com
// max_runs_ is the maximum *total* instances (running + queued) // max_runs_ is the maximum *total* instances (running + queued)
// So we reject when num_queued_ + 1 >= max_runs_ (queued + running >= max) // So we reject when num_queued_ + 1 >= max_runs_ (queued + running >= max)
if (this->num_queued_ + 1 >= this->max_runs_) { if (this->num_queued_ + 1 >= this->max_runs_) {
this->esp_logw_(__LINE__, this->esp_logw_(__LINE__, ESPHOME_LOG_FORMAT("Script '%s' max instances (running + queued) reached!"),
ESPHOME_LOG_FORMAT("Script '%s' maximum total instances (running + queued) exceeded!"),
LOG_STR_ARG(this->name_)); LOG_STR_ARG(this->name_));
return; return;
} }

View File

@@ -31,9 +31,7 @@ async def test_script_queued(
# Patterns for Test 1: Queue depth # Patterns for Test 1: Queue depth
queue_start = re.compile(r"Queue test: START item (\d+)") queue_start = re.compile(r"Queue test: START item (\d+)")
queue_end = re.compile(r"Queue test: END item (\d+)") queue_end = re.compile(r"Queue test: END item (\d+)")
queue_reject = re.compile( queue_reject = re.compile(r"Script 'queue_depth_script' max instances")
r"Script 'queue_depth_script' maximum total instances \(running \+ queued\) exceeded!"
)
# Patterns for Test 2: Ring buffer # Patterns for Test 2: Ring buffer
ring_start = re.compile(r"Ring buffer: START '([A-Z])'") ring_start = re.compile(r"Ring buffer: START '([A-Z])'")
@@ -46,9 +44,7 @@ async def test_script_queued(
# Patterns for Test 4: Rejection # Patterns for Test 4: Rejection
reject_start = re.compile(r"Rejection test: START (\d+)") reject_start = re.compile(r"Rejection test: START (\d+)")
reject_end = re.compile(r"Rejection test: END (\d+)") reject_end = re.compile(r"Rejection test: END (\d+)")
reject_reject = re.compile( reject_reject = re.compile(r"Script 'rejection_script' max instances")
r"Script 'rejection_script' maximum total instances \(running \+ queued\) exceeded!"
)
# Patterns for Test 5: No params # Patterns for Test 5: No params
no_params_end = re.compile(r"No params: END") no_params_end = re.compile(r"No params: END")