diff --git a/homeassistant/components/frontend/mdi_version.py b/homeassistant/components/frontend/mdi_version.py index 7137aafcdbc..9bc0c85f94d 100644 --- a/homeassistant/components/frontend/mdi_version.py +++ b/homeassistant/components/frontend/mdi_version.py @@ -1,2 +1,2 @@ """DO NOT MODIFY. Auto-generated by update_mdi script.""" -VERSION = "1baebe8155deb447230866d7ae854bd9" +VERSION = "9ee3d4466a65bef35c2c8974e91b37c0" diff --git a/homeassistant/components/frontend/www_static/frontend.html.gz b/homeassistant/components/frontend/www_static/frontend.html.gz new file mode 100644 index 00000000000..d1a5ad70a3b Binary files /dev/null and b/homeassistant/components/frontend/www_static/frontend.html.gz differ diff --git a/homeassistant/components/frontend/www_static/mdi.html b/homeassistant/components/frontend/www_static/mdi.html index 4d807a76bf8..2214389b944 100644 --- a/homeassistant/components/frontend/www_static/mdi.html +++ b/homeassistant/components/frontend/www_static/mdi.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/homeassistant/components/frontend/www_static/mdi.html.gz b/homeassistant/components/frontend/www_static/mdi.html.gz new file mode 100644 index 00000000000..963dd1fa60e Binary files /dev/null and b/homeassistant/components/frontend/www_static/mdi.html.gz differ diff --git a/script/build_frontend b/script/build_frontend index f7d9a9fe3eb..b5e41da21df 100755 --- a/script/build_frontend +++ b/script/build_frontend @@ -8,6 +8,7 @@ npm run frontend_prod cp bower_components/webcomponentsjs/webcomponents-lite.min.js .. cp build/frontend.html .. cp build/service_worker.js .. +gzip build/frontend.html -c -k -9 > ../frontend.html.gz # Generate the MD5 hash of the new frontend cd ../.. diff --git a/script/update_mdi.py b/script/update_mdi.py index 7169f1b31eb..96682a26bfa 100755 --- a/script/update_mdi.py +++ b/script/update_mdi.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 """Download the latest Polymer v1 iconset for materialdesignicons.com.""" import hashlib +import gzip import os import re import requests @@ -16,6 +17,7 @@ CUR_VERSION = re.compile(r'VERSION = "([A-Za-z0-9]{32})"') OUTPUT_BASE = os.path.join('homeassistant', 'components', 'frontend') VERSION_OUTPUT = os.path.join(OUTPUT_BASE, 'mdi_version.py') ICONSET_OUTPUT = os.path.join(OUTPUT_BASE, 'www_static', 'mdi.html') +ICONSET_OUTPUT_GZ = os.path.join(OUTPUT_BASE, 'www_static', 'mdi.html.gz') def get_local_version(): @@ -58,6 +60,10 @@ def write_component(version, source): print('Writing icons to', ICONSET_OUTPUT) outp.write(source) + with gzip.open(ICONSET_OUTPUT_GZ, 'wb') as outp: + print('Writing icons gz to', ICONSET_OUTPUT_GZ) + outp.write(source.encode('utf-8')) + with open(VERSION_OUTPUT, 'w') as outp: print('Generating version file', VERSION_OUTPUT) outp.write(