diff --git a/homeassistant/components/http/__init__.py b/homeassistant/components/http/__init__.py index e8738ee59dc..a1312870d4d 100644 --- a/homeassistant/components/http/__init__.py +++ b/homeassistant/components/http/__init__.py @@ -114,10 +114,18 @@ DOMAIN_ICONS = { "wemo": "glyphicon-hdd", "device_tracker": "glyphicon-phone", "chromecast": "glyphicon-picture", - "process": "glyphicon-barcode" + "process": "glyphicon-barcode", + "browser": "glyphicon-globe", + "homeassistant": "glyphicon-home", + "downloader": "glyphicon-download-alt" } +def _get_domain_icon(domain): + return "".format( + DOMAIN_ICONS.get(domain, "")) + + def setup(hass, api_password, server_port=None, server_host=None): """ Sets up the HTTP API and debug interface. """ server_port = server_port or rem.SERVER_PORT @@ -379,15 +387,12 @@ class RequestHandler(BaseHTTPRequestHandler): domain = util.split_entity_id(entity_id)[0] - icon = "".format( - DOMAIN_ICONS.get(domain, "")) - attributes = "
".join( "{}: {}".format(attr, val) for attr, val in state.attributes.items()) write("{}{}{}".format( - icon, entity_id, state.state)) + _get_domain_icon(domain), entity_id, state.state)) if state.state == STATE_ON or state.state == STATE_OFF: if state.state == STATE_ON: @@ -421,15 +426,16 @@ class RequestHandler(BaseHTTPRequestHandler): # Describe bus/services: write(("
" "
" - "
" + "
" "

" " Services

" "" - "")) + "")) for domain, services in sorted( self.server.hass.services.services.items()): - write("
DomainService
DomainService
{}".format(domain)) + write("
{}{}".format( + _get_domain_icon(domain), domain)) write(", ".join( "{1}".format( diff --git a/homeassistant/components/http/www_static/style.css b/homeassistant/components/http/www_static/style.css index 48d7f72f763..419ddcd4cdf 100644 --- a/homeassistant/components/http/www_static/style.css +++ b/homeassistant/components/http/www_static/style.css @@ -1,10 +1,10 @@ @import url(//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/css/bootstrap.min.css); -.states td .glyphicon { - margin-top: 3px; +.states td .glyphicon, .services td .glyphicon { + margin-top: 2px; } -.states td:nth-child(1) { +.states td:nth-child(1), .services td:nth-child(1) { width: 22px; padding-right: 0px; }