Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
import sys
from pathlib import Path
# Get the absolute path to the custom_components folder
custom_components_path = Path(__file__).resolve().parent.parent.parent / "custom_components"
sys.path.append(str(custom_components_path))

Alternatively, you can append the ‘custom_components' folder path to the PYTHONPATH environment variable within the ‘activate’ script of your virtual environment. For example:

Code Block
export PYTHONPATH="/path/to/custom_components:$PYTHONPATH"
Info

If you go this route, you will have to deactivate and reactivate your virtual environment

Next, import the new connector rather than the old one

...