Fix HTTP config serialization (#31319)

This commit is contained in:
Paulus Schoutsen 2020-01-30 09:47:16 -08:00 committed by GitHub
parent 0a1e397119
commit 33361f8580
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 6 deletions

View file

@ -166,7 +166,16 @@ async def async_setup(hass, config):
# If we are set up successful, we store the HTTP settings for safe mode.
store = storage.Store(hass, STORAGE_VERSION, STORAGE_KEY)
await store.async_save(conf)
if CONF_TRUSTED_PROXIES in conf:
conf_to_save = dict(conf)
conf_to_save[CONF_TRUSTED_PROXIES] = [
str(ip.network_address) for ip in conf_to_save[CONF_TRUSTED_PROXIES]
]
else:
conf_to_save = conf
await store.async_save(conf_to_save)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, start_server)