Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app_email/password requested in CLI even if not using libbi #38

Closed
carlosgalvezp opened this issue Apr 25, 2024 · 9 comments
Closed

app_email/password requested in CLI even if not using libbi #38

carlosgalvezp opened this issue Apr 25, 2024 · 9 comments

Comments

@carlosgalvezp
Copy link

Hi!

I'm using the CLI to control my zappi. My understanding is that app_email and app_password are only required for libbi, but still I get prompted for them when using zappi.

I am not able to set dummy values for these, since I get an authentication failure. Is it possible to skip them somehow?

@G6EJD
Copy link

G6EJD commented Apr 25, 2024

You should be using the MyEnergi hub serial for username and the API key for password. But you can’t call the ME servers asynchronously as their security method is session based, then you can log-on once and control all of their products.

@carlosgalvezp
Copy link
Author

Yes, I am using hub serial and API key. But still the CLI still asks me to type app_email and app_password, which I don't want to pass. Pressing Enter is not an option, since I want it to run without user interaction in a cron tab.

@carlosgalvezp
Copy link
Author

Running the CLI like this solves the problem as a workaround:

echo | myenergi zappi ...

This simulates pressing Enter when prompted for app_email.

@trizmark
Copy link
Contributor

I just added a "--skip-oauth" flag to the cli in PR #43
Once that's merged, you can call the cli with that flag and you won't be prompted for app email/password.

@carlosgalvezp
Copy link
Author

Awesome, thanks a lot!

@trizmark
Copy link
Contributor

trizmark commented Jun 3, 2024

@carlosgalvezp 0.2.0 has been released today and now you can use the --skip-oauth flag!

@carlosgalvezp
Copy link
Author

Awesome, just tried it and works like a charm, thank you!

Btw, I realize that password is also required when running myenergi --version, which sounds unnecessary. Perhaps it should behave just like --help?

@trizmark
Copy link
Contributor

trizmark commented Jun 4, 2024

Ah, good catch, but to be fair --version asks for the hub serial number as well if you don't have it in the config. I'll prepare a small PR for this.

@CJNE
Copy link
Owner

CJNE commented Aug 18, 2024

Fixed in 0.2.1, thanks for the PR!

@CJNE CJNE closed this as completed Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants