8000 API history end_time does not work · Issue #9674 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
API history end_time does not work #9674
Closed
@gitmopp

Description

@gitmopp

Home Assistant release (hass --version):
0.54

Python release (python3 --version):
Python 3.5.3

Component/platform:
history

Description of problem:
I want to use the end_time parameter documented here https://home-assistant.io/developers/rest_api/.
It is not documented which time format is expected as end_time. I tried different time formats but didn' t found a working one.
curl -X GET -H "Content-Type: application/json" "http://localhost:8123/api/history/period/2017-09-20T00:00:00+02:00?end_time=2017-09-22T00:00:00+02:00"

Expected:
JSON Output

Traceback (if applicable):

2017-10-03 18:17:11 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 422, in start
    resp = yield from self._request_handler(request)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web.py", line 306, in _handle
    resp = yield from handler(request)
  File "/usr/lib/python3.5/asyncio/coroutines.py", line 213, in coro
    res = yield from res
  File "/usr/lib/python3.5/asyncio/coroutines.py", line 213, in coro
    res = yield from res
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
    return (yield from handler(request))
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/__init__.py", line 428, in handle
    result = yield from result
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/history.py", line 282, in get
    return self.json_message('Invalid end_time', HTTP_BAD_REQUEST)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/dt.py", line 64, in as_utc
    if dattim.tzinfo == UTC:
AttributeError: 'NoneType' object has no attribute 'tzinfo'

Additional info:
curl returns
<html><head><title>500 Internal Server Error</title></head><body><h1>500 Internal Server Error</h1>Server got itself in trouble</body></html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0