-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
35 lines (25 loc) · 870 Bytes
/
__init__.py
File metadata and controls
35 lines (25 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from aiohttp import web
import logging
#import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'my_api'
DEPENDENCIES = ['http']
class HTMLView(HomeAssistantView):
def html(self, body, status=200, headers=None):
response = web.Response(body=body,
content_type='text/html',
status=status,
headers=headers)
response.enable_compression()
return response
def setup(hass, config):
from .youtube import youtube
from .tvpassport import tvpassport
from .cnn import cnn
from .echo import echo
hass.http.register_view(youtube)
hass.http.register_view(tvpassport)
hass.http.register_view(cnn)
hass.http.register_view(echo)
return True