diff --git a/homeassistant/components/frontend/mdi_version.py b/homeassistant/components/frontend/mdi_version.py index c9d06a4b300..a8106ecd77e 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 = "38EF63D0474411E4B3CF842B2B6CFE1B" +VERSION = "7d76081c37634d36af21f5cc1ca79408" diff --git a/homeassistant/components/frontend/www_static/mdi.html b/homeassistant/components/frontend/www_static/mdi.html index 42212a3a301..13b003806b3 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/script/update_mdi.py b/script/update_mdi.py index f7899be3964..c61a3808b39 100755 --- a/script/update_mdi.py +++ b/script/update_mdi.py @@ -2,7 +2,7 @@ """ Downloads the latest Polymer v1 iconset version for materialdesignicons.com """ - +import hashlib import os import re import requests @@ -75,17 +75,18 @@ def main(): print("materialdesignicons.com icon updater") local_version = get_local_version() - remote_version, remote_url = get_remote_version() - print('Local version:', local_version) - print('Remote version:', remote_version) + # The remote version is not reliable. + _, remote_url = get_remote_version() - if local_version == remote_version: + source = clean_component(requests.get(remote_url).text) + new_version = hashlib.md5(source.encode('utf-8')).hexdigest() + + if local_version == new_version: print('Already on the latest version.') sys.exit() - write_component(remote_version, - clean_component(requests.get(remote_url).text)) + write_component(new_version, source) print('Updated to latest version') if __name__ == '__main__':