mirror of
https://github.com/esphome/esphome.git
synced 2026-09-01 10:36:01 +00:00
Move the pure logic (string building, escaping, byte length calculation) out of the nested closure into a module-level function that can be tested without codegen mocks. Tests cover both copilot review concerns: empty friendly_name with MAC suffix, and UTF-8 byte length for non-ASCII characters.