diff --git a/esphome/wizard.py b/esphome/wizard.py index 5d290a3592..34ff0ec6c7 100644 --- a/esphome/wizard.py +++ b/esphome/wizard.py @@ -75,7 +75,11 @@ def sanitize_double_quotes(value): def wizard_file(**kwargs): letters = string.ascii_letters + string.digits - kwargs['fallback_name'] = "{} Fallback Hotspot".format(kwargs['name'].replace('_', ' ').title()) + ap_name_base = kwargs['name'].replace('_', ' ').title() + ap_name = "{} Fallback Hotspot".format(ap_name_base) + if len(ap_name) > 32: + ap_name = ap_name_base + kwargs['fallback_name'] = ap_name kwargs['fallback_psk'] = ''.join(random.choice(letters) for _ in range(12)) config = BASE_CONFIG.format(**kwargs)