PEP8 style fixes for HTTPInterface
parent
e586d8debc
commit
416816cef7
|
@ -265,20 +265,20 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
"<html>"
|
"<html>"
|
||||||
"<head><title>Home Assistant</title>"
|
"<head><title>Home Assistant</title>"
|
||||||
"<link rel='stylesheet' type='text/css' "
|
"<link rel='stylesheet' type='text/css' "
|
||||||
"href='/static/style.css'>"
|
" href='/static/style.css'>"
|
||||||
"<link rel='icon' href='/static/favicon.ico' "
|
"<link rel='icon' href='/static/favicon.ico' "
|
||||||
"type='image/x-icon' />"
|
" type='image/x-icon' />"
|
||||||
"</head>"
|
"</head>"
|
||||||
"<body>"
|
"<body>"
|
||||||
"<div class='container'>"
|
"<div class='container'>"
|
||||||
"<form class='form-signin' action='{}' method='GET'>"
|
"<form class='form-signin' action='{}' method='GET'>"
|
||||||
|
|
||||||
"<input type='text' class='form-control' name='api_password' "
|
"<input type='text' class='form-control' name='api_password' "
|
||||||
"placeholder='API Password for Home Assistant' "
|
" placeholder='API Password for Home Assistant' "
|
||||||
"required autofocus>"
|
" required autofocus>"
|
||||||
|
|
||||||
"<button class='btn btn-lg btn-primary btn-block' "
|
"<button class='btn btn-lg btn-primary btn-block' "
|
||||||
"type='submit'>Enter</button>"
|
" type='submit'>Enter</button>"
|
||||||
|
|
||||||
"</form>"
|
"</form>"
|
||||||
"</div>"
|
"</div>"
|
||||||
|
@ -299,14 +299,13 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
write(("<html>"
|
write(("<html>"
|
||||||
"<head><title>Home Assistant</title>"
|
"<head><title>Home Assistant</title>"
|
||||||
"<link rel='stylesheet' type='text/css' "
|
"<link rel='stylesheet' type='text/css' "
|
||||||
"href='/static/style.css'>"
|
" href='/static/style.css'>"
|
||||||
"<link rel='icon' href='/static/favicon.ico' "
|
"<link rel='icon' href='/static/favicon.ico' "
|
||||||
"type='image/x-icon' />"
|
" type='image/x-icon' />"
|
||||||
"</head>"
|
"</head>"
|
||||||
"<body>"
|
"<body>"
|
||||||
"<div class='container'>"
|
"<div class='container'>"
|
||||||
"<div class='page-header'><h1>Home Assistant</h1></div>"
|
"<div class='page-header'><h1>Home Assistant</h1></div>"))
|
||||||
))
|
|
||||||
|
|
||||||
# Flash message support
|
# Flash message support
|
||||||
if self.server.flash_message:
|
if self.server.flash_message:
|
||||||
|
@ -321,9 +320,9 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
"<div class='col-xs-12'>"
|
"<div class='col-xs-12'>"
|
||||||
"<div class='panel panel-primary'>"
|
"<div class='panel panel-primary'>"
|
||||||
"<div class='panel-heading'><h2 class='panel-title'>"
|
"<div class='panel-heading'><h2 class='panel-title'>"
|
||||||
"States</h2></div>"
|
" States</h2></div>"
|
||||||
"<form method='post' action='/change_state' "
|
"<form method='post' action='/change_state' "
|
||||||
"class='form-change-state'>"
|
" class='form-change-state'>"
|
||||||
"<input type='hidden' name='api_password' value='{}'>"
|
"<input type='hidden' name='api_password' value='{}'>"
|
||||||
"<table class='table'><tr>"
|
"<table class='table'><tr>"
|
||||||
"<th>Entity ID</th><th>State</th>"
|
"<th>Entity ID</th><th>State</th>"
|
||||||
|
@ -350,14 +349,14 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
# Change state form
|
# Change state form
|
||||||
write(("<tr><td><input name='entity_id' class='form-control' "
|
write(("<tr><td><input name='entity_id' class='form-control' "
|
||||||
"placeholder='Entity ID'></td>"
|
" placeholder='Entity ID'></td>"
|
||||||
"<td><input name='new_state' class='form-control' "
|
"<td><input name='new_state' class='form-control' "
|
||||||
"placeholder='New State'></td>"
|
" placeholder='New State'></td>"
|
||||||
"<td><textarea rows='3' name='attributes' class='form-control' "
|
"<td><textarea rows='3' name='attributes' class='form-control' "
|
||||||
"placeholder='State Attributes (JSON, optional)'>"
|
" placeholder='State Attributes (JSON, optional)'>"
|
||||||
"</textarea></td>"
|
"</textarea></td>"
|
||||||
"<td><button type='submit' class='btn btn-default'>"
|
"<td><button type='submit' class='btn btn-default'>"
|
||||||
"Set State</button></td></tr>"
|
"Set State</button></td></tr>"
|
||||||
|
|
||||||
"</table></form></div>"
|
"</table></form></div>"
|
||||||
|
|
||||||
|
@ -368,7 +367,7 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
"<div class='col-xs-6'>"
|
"<div class='col-xs-6'>"
|
||||||
"<div class='panel panel-primary'>"
|
"<div class='panel panel-primary'>"
|
||||||
"<div class='panel-heading'><h2 class='panel-title'>"
|
"<div class='panel-heading'><h2 class='panel-title'>"
|
||||||
"Services</h2></div>"
|
" Services</h2></div>"
|
||||||
"<table class='table'>"
|
"<table class='table'>"
|
||||||
"<tr><th>Domain</th><th>Service</th></tr>"))
|
"<tr><th>Domain</th><th>Service</th></tr>"))
|
||||||
|
|
||||||
|
@ -382,45 +381,45 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
"<div class='col-xs-6'>"
|
"<div class='col-xs-6'>"
|
||||||
"<div class='panel panel-primary'>"
|
"<div class='panel panel-primary'>"
|
||||||
"<div class='panel-heading'><h2 class='panel-title'>"
|
"<div class='panel-heading'><h2 class='panel-title'>"
|
||||||
"Call Service</h2></div>"
|
" Call Service</h2></div>"
|
||||||
"<div class='panel-body'>"
|
"<div class='panel-body'>"
|
||||||
"<form method='post' action='/call_service' "
|
"<form method='post' action='/call_service' "
|
||||||
"class='form-horizontal form-fire-event'>"
|
" class='form-horizontal form-fire-event'>"
|
||||||
"<input type='hidden' name='api_password' value='{}'>"
|
"<input type='hidden' name='api_password' value='{}'>"
|
||||||
|
|
||||||
"<div class='form-group'>"
|
"<div class='form-group'>"
|
||||||
"<label for='domain' class='col-xs-3 control-label'>"
|
" <label for='domain' class='col-xs-3 control-label'>"
|
||||||
"Domain</label>"
|
" Domain</label>"
|
||||||
"<div class='col-xs-9'>"
|
" <div class='col-xs-9'>"
|
||||||
"<input type='text' class='form-control' id='domain'"
|
" <input type='text' class='form-control' id='domain'"
|
||||||
" name='domain' placeholder='Service Domain'>"
|
" name='domain' placeholder='Service Domain'>"
|
||||||
"</div>"
|
" </div>"
|
||||||
"</div>"
|
"</div>"
|
||||||
|
|
||||||
"<div class='form-group'>"
|
"<div class='form-group'>"
|
||||||
"<label for='service' class='col-xs-3 control-label'>"
|
" <label for='service' class='col-xs-3 control-label'>"
|
||||||
"Service</label>"
|
" Service</label>"
|
||||||
"<div class='col-xs-9'>"
|
" <div class='col-xs-9'>"
|
||||||
"<input type='text' class='form-control' id='service'"
|
" <input type='text' class='form-control' id='service'"
|
||||||
" name='service' placeholder='Service name'>"
|
" name='service' placeholder='Service name'>"
|
||||||
"</div>"
|
" </div>"
|
||||||
"</div>"
|
"</div>"
|
||||||
|
|
||||||
"<div class='form-group'>"
|
"<div class='form-group'>"
|
||||||
"<label for='service_data' class='col-xs-3 control-label'>"
|
" <label for='service_data' class='col-xs-3 control-label'>"
|
||||||
"Service data</label>"
|
" Service data</label>"
|
||||||
"<div class='col-xs-9'>"
|
" <div class='col-xs-9'>"
|
||||||
"<textarea rows='3' class='form-control' id='service_data'"
|
" <textarea rows='3' class='form-control' id='service_data'"
|
||||||
" name='service_data' placeholder='Service Data "
|
" name='service_data' placeholder='Service Data "
|
||||||
"(JSON, optional)'></textarea>"
|
"(JSON, optional)'></textarea>"
|
||||||
"</div>"
|
" </div>"
|
||||||
"</div>"
|
"</div>"
|
||||||
|
|
||||||
"<div class='form-group'>"
|
"<div class='form-group'>"
|
||||||
"<div class='col-xs-offset-3 col-xs-9'>"
|
" <div class='col-xs-offset-3 col-xs-9'>"
|
||||||
"<button type='submit' class='btn btn-default'>"
|
" <button type='submit' class='btn btn-default'>"
|
||||||
"Call Service</button>"
|
" Call Service</button>"
|
||||||
"</div>"
|
" </div>"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</div></div></div>"
|
"</div></div></div>"
|
||||||
|
@ -431,7 +430,7 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
"<div class='col-xs-6'>"
|
"<div class='col-xs-6'>"
|
||||||
"<div class='panel panel-primary'>"
|
"<div class='panel panel-primary'>"
|
||||||
"<div class='panel-heading'><h2 class='panel-title'>"
|
"<div class='panel-heading'><h2 class='panel-title'>"
|
||||||
"Events</h2></div>"
|
" Events</h2></div>"
|
||||||
"<table class='table'>"
|
"<table class='table'>"
|
||||||
"<tr><th>Event</th><th>Listeners</th></tr>"))
|
"<tr><th>Event</th><th>Listeners</th></tr>"))
|
||||||
|
|
||||||
|
@ -445,36 +444,36 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
"<div class='col-xs-6'>"
|
"<div class='col-xs-6'>"
|
||||||
"<div class='panel panel-primary'>"
|
"<div class='panel panel-primary'>"
|
||||||
"<div class='panel-heading'><h2 class='panel-title'>"
|
"<div class='panel-heading'><h2 class='panel-title'>"
|
||||||
"Fire Event</h2></div>"
|
" Fire Event</h2></div>"
|
||||||
"<div class='panel-body'>"
|
"<div class='panel-body'>"
|
||||||
"<form method='post' action='/fire_event' "
|
"<form method='post' action='/fire_event' "
|
||||||
"class='form-horizontal form-fire-event'>"
|
" class='form-horizontal form-fire-event'>"
|
||||||
"<input type='hidden' name='api_password' value='{}'>"
|
"<input type='hidden' name='api_password' value='{}'>"
|
||||||
|
|
||||||
"<div class='form-group'>"
|
"<div class='form-group'>"
|
||||||
"<label for='event_type' class='col-xs-3 control-label'>"
|
" <label for='event_type' class='col-xs-3 control-label'>"
|
||||||
"Event type</label>"
|
" Event type</label>"
|
||||||
"<div class='col-xs-9'>"
|
" <div class='col-xs-9'>"
|
||||||
"<input type='text' class='form-control' id='event_type'"
|
" <input type='text' class='form-control' id='event_type'"
|
||||||
" name='event_type' placeholder='Event Type'>"
|
" name='event_type' placeholder='Event Type'>"
|
||||||
"</div>"
|
" </div>"
|
||||||
"</div>"
|
"</div>"
|
||||||
|
|
||||||
"<div class='form-group'>"
|
"<div class='form-group'>"
|
||||||
"<label for='event_data' class='col-xs-3 control-label'>"
|
" <label for='event_data' class='col-xs-3 control-label'>"
|
||||||
"Event data</label>"
|
" Event data</label>"
|
||||||
"<div class='col-xs-9'>"
|
" <div class='col-xs-9'>"
|
||||||
"<textarea rows='3' class='form-control' id='event_data'"
|
" <textarea rows='3' class='form-control' id='event_data'"
|
||||||
" name='event_data' placeholder='Event Data "
|
" name='event_data' placeholder='Event Data "
|
||||||
"(JSON, optional)'></textarea>"
|
"(JSON, optional)'></textarea>"
|
||||||
"</div>"
|
" </div>"
|
||||||
"</div>"
|
"</div>"
|
||||||
|
|
||||||
"<div class='form-group'>"
|
"<div class='form-group'>"
|
||||||
"<div class='col-xs-offset-3 col-xs-9'>"
|
" <div class='col-xs-offset-3 col-xs-9'>"
|
||||||
"<button type='submit' class='btn btn-default'>"
|
" <button type='submit' class='btn btn-default'>"
|
||||||
"Fire Event</button>"
|
" Fire Event</button>"
|
||||||
"</div>"
|
" </div>"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</div></div></div>"
|
"</div></div></div>"
|
||||||
|
|
Loading…
Reference in New Issue