jaraco / jaraco.abode

MIT License
11 stars 9 forks source link

"Timeline event is not valid" errors in HomeAssistant with v3.2.1 #18

Closed tradel closed 1 year ago

tradel commented 1 year ago

Since upgrading HomeAssistant to use v3.2.1, several unit tests are now failing with the following exception:

tests/conftest.py:427: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jaraco.abode.event_controller.EventController object at 0xffff84763850>, timeline_events = 'abode_capture', callback = <bound method AbodeCamera._capture_callback of <Entity None: idle>>

    def add_timeline_callback(self, timeline_events, callback):
        """Register a callback for a specific timeline event."""
        if not timeline_events:
            return False

        for timeline_event in always_iterable(timeline_events):
            if not isinstance(timeline_event, dict):
>               raise jaraco.abode.Exception(ERROR.EVENT_CODE_MISSING)
E               jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.

/home/vscode/.local/lib/python3.9/site-packages/jaraco/abode/event_controller.py:158: Exception
tradel commented 1 year ago

Here are the specific tests that failed. I will see if I can debug further.

FAILED tests/components/abode/test_camera.py::test_entity_registry - jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.
FAILED tests/components/abode/test_camera.py::test_attributes - jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.
FAILED tests/components/abode/test_camera.py::test_capture_image - jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.
FAILED tests/components/abode/test_camera.py::test_camera_on - jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.
FAILED tests/components/abode/test_camera.py::test_camera_off - jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.
FAILED tests/components/abode/test_config_flow.py::test_step_user - jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.
FAILED tests/components/abode/test_config_flow.py::test_step_mfa - jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.
FAILED tests/components/abode/test_init.py::test_add_unique_id - jaraco.abode.exceptions.Exception: Timeline event is not valid, event code missing.
tradel commented 1 year ago

My bad. I was using Groups.CAPTURE instead of TIMELINE.CAPTURE_IMAGE in the HomeAssistant tests. Closing as PEBKAC.