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

made the cli script a little faster for rollershutter controlling #34

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

realbuxtehuder
Copy link
Contributor

Working with the cli script:
Made the script a little faster for rollershutter controlling by:

  • printing the paired devices only when requested (by a new cli command "--show_paired")
  • sending the commands only once
  • removing some delays

@gluap
Copy link
Owner

gluap commented Feb 28, 2022

Quick question: why move the cli class to into the unit tests? It'll take me some time to read your changes, but I feel you might have misinterpreted the "tests" directory as that class does not contain a single test so I thought I'd ask right away.

I know the unit tests currently don't run automatically because travis started to charge even for basic services - I'm working on getting them to run in github actions instead.

@realbuxtehuder
Copy link
Contributor Author

Yes, I misinterpreted the "test" directory. I wasn't aware of unit-testing.
My intention was just to move it out of the duofern_cli.py file and put it somewhere else, because it wasn't used there and made it a little harder to understand how the script works. I thought it would made it easier for other people who might want to contribute to this project in the future...
Do you use the cli class somewhere else?

@gluap
Copy link
Owner

gluap commented Mar 1, 2022

Actually it was a prototype for having a CLI that allows to do several actions one after another, but I never finished it so it is not used anywhere. The Idea was to start duofern_cli without commands and then entering a prompt that would allow you to write "up kitchen" or "up all" or any commands, after which it would return to the duofern_cli prompt and allow you to enter more commands. A bit like the python interpreter when used without a script. At this point I'd say it's fine to entirely remove that code!
I imagined the workflow to look as follows:

gluap@desktop:~/> duofern_cli
> up kitchen
opening blinds "kitchen"
> up all
opening all blinds

I fixed the unit tests for python3.8 and python 3.9 last night.

@realbuxtehuder
Copy link
Contributor Author

Nice idea. It would eliminate the need of starting and stopping the stick every time and would give access to the status messages sent by duofern devices, but in my eyes the usecase is not so broad compared to the approach of calling the duofern_cli script with commands. That is nice not only for setting up and testing the system, but also for simple automation, e.g. by using cron to do timed roller movements without coding...

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

Successfully merging this pull request may close these issues.

2 participants