mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 23:21:54 +00:00 
			
		
		
		
	Merge branch 'helper_for_name_suffix' into integration
This commit is contained in:
		| @@ -246,6 +246,9 @@ std::string make_name_with_suffix(const std::string &name, char sep, const std:: | |||||||
|  |  | ||||||
|   // Silently truncate if needed: prioritize keeping the full suffix |   // Silently truncate if needed: prioritize keeping the full suffix | ||||||
|   if (total_len >= MAX_NAME_WITH_SUFFIX_SIZE) { |   if (total_len >= MAX_NAME_WITH_SUFFIX_SIZE) { | ||||||
|  |     // NOTE: This calculation could underflow if suffix_len >= MAX_NAME_WITH_SUFFIX_SIZE - 2, | ||||||
|  |     // but this is safe because this helper is only called with small suffixes: | ||||||
|  |     // MAC suffixes (6-12 bytes), ".local" (6 bytes), etc. | ||||||
|     name_len = MAX_NAME_WITH_SUFFIX_SIZE - suffix_len - 2;  // -2 for separator and null terminator |     name_len = MAX_NAME_WITH_SUFFIX_SIZE - suffix_len - 2;  // -2 for separator and null terminator | ||||||
|     total_len = name_len + 1 + suffix_len; |     total_len = name_len + 1 + suffix_len; | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -244,7 +244,7 @@ def main() -> None: | |||||||
|         component |         component | ||||||
|         for component in changed_components |         for component in changed_components | ||||||
|         if (component_test_dir := tests_dir / component).exists() |         if (component_test_dir := tests_dir / component).exists() | ||||||
|         and any(component_test_dir.glob("test.*.yaml")) |         and next(component_test_dir.glob("test.*.yaml"), None) is not None | ||||||
|     ] |     ] | ||||||
|  |  | ||||||
|     # Build output |     # Build output | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user