Guy293 / Tami4EdgeAPI

Tami 4 Edge / Edge+ API In Python
https://pypi.org/project/Tami4EdgeAPI/
MIT License
16 stars 2 forks source link

AttributeError: module 'Tami4EdgeAPI' has no attribute 'request_otp' #1

Closed OfirYaron closed 1 year ago

OfirYaron commented 1 year ago

Hi Guy, there must be something I'm doing wrong, or a missing resource on my environment, I'de love for some guidance,

here is my code: (taken from your example)

#!/usr/bin/env python3

import Tami4EdgeAPI

# You must add the country code!
phone_number = "+97250xxxxxxx"

Tami4EdgeAPI.request_otp()
otp_code = input("Enter OTP: ")
refresh_token = Tami4EdgeAPI.submit_otp(otp_code)
output(refresh_token)

installed the library using pip3 and running with python3

➜  tami4-auto-boil pip3 --version
pip 20.3.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
➜  tami4-auto-boil python3 --version
Python 3.9.1

Thanks

Guy293 commented 1 year ago

Hi, can you try from Tami4EdgeAPI import Tami4EdgeAPI ? It's my mistake, I will edit the readme.

OfirYaron commented 1 year ago

Thanks, issue resolved!

(there was another small mistake in the readme example, Tami4EdgeAPI.request_otp should receive the phone_number as a parameter)

Guy293 commented 1 year ago

Thanks, fixed. Let me know if you find any more issues. Also, if you're interested I've developed an addon for home assistant, It's pull request status is currently stuck, but you can still manually install it https://github.com/home-assistant/core/pull/76756.