Skip to content

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

Open
realbuxtehuder wants to merge 3 commits into
gluap:masterfrom
realbuxtehuder:slender-cli
Open

made the cli script a little faster for rollershutter controlling#34
realbuxtehuder wants to merge 3 commits into
gluap:masterfrom
realbuxtehuder:slender-cli

Conversation

@realbuxtehuder

Copy link
Copy Markdown
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

gluap commented Feb 28, 2022

Copy link
Copy Markdown
Owner

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
Copy Markdown
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

gluap commented Mar 1, 2022

Copy link
Copy Markdown
Owner

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
Copy Markdown
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