Bump frontend to 20180228.1 (#12786)

* Bump frontend to 20180228.1

* Update reqs
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-02-28 13:26:49 -08:00
1 parent 3628fcf083
commit e2a2fe36fc
3 files changed
+6 -27

No files matched your search

+4 -22
View File
@@ -23,7 +23,7 @@ from homeassistant.const import CONF_NAME, EVENT_THEMES_UPDATED
from homeassistant.core import callback
from homeassistant.loader import bind_hass
REQUIREMENTS = ['home-assistant-frontend==20180228.0', 'user-agents==1.1.0']
REQUIREMENTS = ['home-assistant-frontend==20180228.1']
DOMAIN = 'frontend'
DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log']
@@ -553,6 +553,8 @@ def _is_latest(js_option, request):
Set according to user's preference and URL override.
"""
import hass_frontend
if request is None:
return js_option == 'latest'
@@ -573,25 +575,5 @@ def _is_latest(js_option, request):
return js_option == 'latest'
useragent = request.headers.get('User-Agent')
if not useragent:
return False
from user_agents import parse
useragent = parse(useragent)
# on iOS every browser is a Safari which we support from version 11.
if useragent.os.family == 'iOS':
# Was >= 10, temp setting it to 12 to work around issue #11387
return useragent.os.version[0] >= 12
family_min_version = {
'Chrome': 54, # Object.values
'Chrome Mobile': 54,
'Firefox': 47, # Object.values
'Firefox Mobile': 47,
'Opera': 41, # Object.values
'Edge': 14, # Array.prototype.includes added in 14
'Safari': 10, # Many features not supported by 9
}
version = family_min_version.get(useragent.browser.family)
return version and useragent.browser.version[0] >= version
return useragent and hass_frontend.version(useragent)