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

Feat show valid service entities #281

Merged
merged 3 commits into from
Feb 14, 2024
Merged

Conversation

EdLeckert
Copy link
Collaborator

Show only valid entities in the UI when configuring services. Fixes Issue #280 .

Services that affect the controller will list switch.<controller>_enabled.

Services that affect programs will list all switch.<program>_program_enabled entities.

Services that affect stations will list all switch.<station>_station_enabled entities.

Services that affect more than one of the above will list multiple types of entities.

The UI will not list values under Choose area or Choose device, as these would then select inappropriate entities for the service.

While other legitimate entities such as sensor.<station>_station_status could have also been listed, they provide no additional value and were left out to prevent clutter. However, nothing prevents a user from using these in YAML, so existing automations and scripts using these types of entities will continue to work.

services.yaml now uses the target keyword rather than fields to specify valid entities.

I've tested this against the examples in the docs, but additional testing by others would be appreciated.

Copy link
Collaborator

@curlydingo curlydingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Simplifies the experience a lot. I've tested all the services (against 2024.2.1) except for setting water level since it's the middle of summer here and I didn't want to forget to put it back. Really should figure out how to get a test environment set up for this sort of stuff.

I noticed that there's no selector for run_seconds in the run service. Technically a different issue but should we just add it here?

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@EdLeckert
Copy link
Collaborator Author

Really should figure out how to get a test environment set up for this sort of stuff.

I use VirtualBox on Windows. I only have the one physical OpenSprinkler controller, so I just disable the integration on my production system when testing with the virtual one.

I noticed that there's no selector for run_seconds in the run service. Technically a different issue but should we just add it here?

Well, it was there at one point in my testing. Now it's back. 😏

@curlydingo
Copy link
Collaborator

I use VirtualBox on Windows. I only have the one physical OpenSprinkler controller, so I just disable the integration on my production system when testing with the virtual one.

I find the HA devcontainer works really well for a test instance of the integration, but I'm hoping to find a way to run the OpenSprinkler firmware as a stub somewhere and avoid using my actual hardware. Relying on the hardware means I can't test all features, and I can only test when I don't have clothes out on the line :)

@vinteo vinteo merged commit 01f9156 into master Feb 14, 2024
19 checks passed
@vinteo vinteo deleted the feat-show-valid-service-entities branch February 14, 2024 21:45
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.

3 participants