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

CLI Plugin: List items matching a pattern #44

Closed
wants to merge 3 commits into from

Conversation

ohinckel
Copy link

Just an idea: I have a lot of items and the la command output is really large and i need to search for the items I currently want to see, which is not handy.

I implemented a item matching mechanism using the sh.match_item() function instead of sh.return_item() for:

  • ls - will list all matching items, e.g. ls groundfloor.*.light
  • update, up - will update all matching items to value, e.g. up groundfloor.*.light = True

Maybe we should use a new keyword for the update command, since this actually change values and it could happen that someone change a lot of values accidentally by typing a * somewhere in the path.

Since every time the match_item() function is used, this patch will slightly slow down the mentioned commands. I did not a benchmark on this, since the CLI interface is mainly used for developers, debugging or testing purpose.

The documentation update is not included in this patch - I can do this if we want to support this feature.

@ohinckel
Copy link
Author

ohinckel commented May 14, 2016

Created new PR smarthomeNG/smarthome#46 in new project and will close this issue now. Thanks for your great application!

@ohinckel ohinckel closed this May 14, 2016
@ohinckel ohinckel deleted the dev-cli-item-matching branch September 4, 2016 20:05
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.

None yet

1 participant