AlexxIT / YandexStation

Управление Яндекс.Станцией и другими устройствами умного дома с Алисой из Home Assistant
https://t.me/AlexxIT_SmartHome
MIT License
1.27k stars 119 forks source link

Fix '<=' not supported between instances of 'float' and 'NoneType' #493

Closed AlexxIT closed 2 months ago

AlexxIT commented 2 months ago
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 823, in get
    return await self.handle(request, camera)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 863, in handle
    stream = await camera.handle_async_mjpeg_stream(request)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/yandex_station/camera.py", line 70, in handle_async_mjpeg_stream
    await self.handle_lyrics(response, lyrics, self.lyrics_content_id)
  File "/config/custom_components/yandex_station/camera.py", line 112, in handle_lyrics
    if not (lyric_pos <= media_position < lyric_pos_next):
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'float' and 'NoneType'
AlexxIT commented 2 months ago
File "/config/custom_components/yandex_station/camera.py", line 70, in handle_async_mjpeg_stream
    await self.handle_lyrics(response, lyrics, self.lyrics_content_id)
  File "/config/custom_components/yandex_station/camera.py", line 106, in handle_lyrics
    dt = datetime.now(UTC) - entity.media_position_updated_at
         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType'
AlexxIT commented 2 months ago

https://github.com/AlexxIT/YandexStation/releases/tag/v3.15.1