mark1foley/ha-gtfs-rt-v2

How to Use Test.py Script

Closed this issue · 1 comments

Hello,

I cannot figure out how to use the test script. When I execute it outside of my home assistant instance, I get an error when it tries to import homeassistant.

My Home Assistant install is HAOS and when I shell in I get the HA CLI. I can dump to the VM's OS prompt however python doesn't appear to be installed.

Next I tried getting to the docker prompt. It does have python installed, but when I try the script I am getting missing modules.

I feel like I'm going about this incorrectly. There's gotta be a better way.

Thanks everyone.

I was able to get the test script working in the docker container for my home assistant instance:

# docker exec -it homeassistant /bin/bash
homeassistant:/config# cd custom_components/gtfs_rt
homeassistant:/config/custom_components/gtfs_rt# python3 ./test.py -f test_translink.yaml -d INFO
ERROR ABOUT MISSING schema MODULE
homeassistant:/config/custom_components/gtfs_rt# pip3 install schema
SCHEMA INSTALLED
homeassistant:/config/custom_components/gtfs_rt# python3 ./test.py -f test_translink.yaml -d INFO
CORRECT OUTPUT

This can be closed.