Skip to content

Commit

Permalink
Update fingerprints_in_homeassistant.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
rikroe committed Feb 16, 2024
1 parent b5567e6 commit 4bfd790
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions docs/source/development/fingerprints_in_homeassistant.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ Sometimes it can be useful to load the **fingerprints** used for our **pytest su
This enables debugging of the UI in Home Assistant which is not possible from pytest alone.

.. warning::
If not already done, `set up the Home Assistant development environment <https://developers.home-assistant.io/docs/development_environment>`_.
This is for the `Home Assistant development environment <https://developers.home-assistant.io/docs/development_environment>`_ only! Do not do this on your live instance!

Now start Home Assistant at least once and let all python packages install (``hass -c ./config``).
If not already done, set up the **BMW Connected Drive Integration** in Home Assistant.
Setup and start Home Assistant in the development environment at least once and let all python packages install (``hass -c ./config``).
If not already done, set up the **BMW Connected Drive Integration**. You do not even have to log in with your own account. It is sufficient if the dependencies are installed (which is done when you see the login form).
Shut down Homeassistant afterwards.

Now, we have to "hack" our mocked backend calls into Home Assistant.

.. note::
Doing so will remove your own account!

Edit ``homeassistant/components/bmw_connected_drive/coordinator.py`` and locate the function ``_async_update_data``. We now have to replace ``await self.account.get_vehicles()``. The ``try .. except`` block should look like this:

.. code-block:: python
Expand All @@ -27,5 +24,4 @@ Edit ``homeassistant/components/bmw_connected_drive/coordinator.py`` and locate
except:
...
.. note::
As the first parameter, you can specify a list of VINs for debugging or leave it empty (``None`` or ``[]``) to load all vehicles of our test suite.
As the first parameter, you can specify a list of VINs for debugging or leave it empty (``None`` or ``[]``) to load all vehicles of our test suite.

0 comments on commit 4bfd790

Please sign in to comment.