Prevent too long fallback AP SSID

This commit is contained in:
Otto Winter 2019-06-30 09:14:04 +02:00
parent 7b4366bfef
commit 5a76e61b1e
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E

View file

@ -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)