#clone the repo locally, then do `pip

1 messages · Page 1 of 1 (latest)

night whale
#

It does seem to work outside of HA. In the devcontainer that is created with ha-mymeter, as far as I can tell, it loads the package correctly. When I navigate to the install location home/vscode/.local/lib/python3.11/site-packages/mymeter/ it is there (same place as homeassistant package).

2023-11-17 18:52:38.331 INFO (SyncWorker_3) [homeassistant.util.package] Attempting install of mymeter==0.0.3
2023-11-17 18:52:43.923 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration mymeter: cannot import name 'MyMeter' from 'mymeter' (/workspaces/ha-mymeter/custom_components/mymeter/__init__.py)
2023-11-17 18:52:43.924 WARNING (MainThread) [asyncio] Executing <Task finished name='config entry flow mymeter 1b723107722153803cef5d671cc49e96' coro=<ConfigEntriesFlowManager._async_init() done, defined at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/config_entries.py:857> exception=UnknownHandler() created at /usr/local/lib/python3.11/asyncio/tasks.py:384> took 0.167 seconds

Sorry, I am a novice in programming and python. So I could be missing something dumb...

night whale
#

To confirm, I created a file inside the container that contained the below code and it worked correctly.

from mymeter import MyMeter
import aiohttp
import asyncio
from datetime import datetime


async def main():
    username = "redacted"
    password = "redacted"

    async with aiohttp.ClientSession() as session:
        meter = MyMeter(session=session, username=username, password=password)
        await meter.async_login()
        start_date = datetime(2023, 11, 17)
        results = await meter.async_get_usage_reads(start_date=start_date)
        for result in results or []:
            print(result)


asyncio.run(main())
floral pine
#

I’ll pull this down later tonight and take a look

night whale
#

Thank you so much!

floral pine
#

so I ran your integration as a custom component and I was able to get to the form where I put in the email and password

#

I wonder if maybe your devcontainer is somehow configured incorrectly?

night whale
floral pine
#

no, I ran HA from the command line

#

I have never really introduced devcontainers into my workflow

#

I'm on a mac and don't like having docker running all the time so it's extra steps for me to start it up then start up the container

night whale
#

Makes sense. Is there documentation on how to run HA from the command line? I have never tried that before.