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

WIP: Wildcard support for entity_id lists #12380

Closed
wants to merge 3 commits into from
Closed

WIP: Wildcard support for entity_id lists #12380

wants to merge 3 commits into from

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Feb 13, 2018

Description:

Adding wildcard support through fnmatch pattern for entity_id lists. This could be quite useful for a number of components:

  • Groups
  • Recorder
  • History
  • Logbook
  • ..

To enable this, the component has to be updated. As an example I included an updated version for the min_max sensor. It probably isn't the most elegant way to do it, but a start. Currently this is a Work in Progress.

https://community.home-assistant.io/t/wildcard-operators-for-groups/4643
https://community.home-assistant.io/t/allow-wildcard-for-entity-selection-in-config-files/9029
https://community.home-assistant.io/t/wildcard-entities-in-groups/10021

Related: #5215

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: min_max
    entity_ids:
      - input_number.slider*

input_number:
  slider1:
    name: Slider
    initial: 30
    min: -20
    max: 50
    step: 2
  slider2:
    name: Slider2
    initial: 10
    min: -50
    max: 20
    step: 2

Checklist:

  • The code change is tested and works locally.

If user exposed functionality or configuration variables are added/changed:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

* cv.entity_id_pattern_list
* core.valid_entity_id_fnmatch_pattern
* Added cv test
* Changed EPM to handle entitiy_patterns tuples
* Updated EPM tests
* Added support for entity_pattern_matching
@cdce8p
Copy link
Member Author

cdce8p commented Feb 16, 2018

Closing PR: home-assistant/architecture#7

@cdce8p cdce8p closed this Feb 16, 2018
@cdce8p cdce8p deleted the entity_matching branch February 16, 2018 19:33
@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants