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

Add Device and Integration Services to ISY994 #35467

Merged
merged 9 commits into from
May 11, 2020
Merged

Add Device and Integration Services to ISY994 #35467

merged 9 commits into from
May 11, 2020

Conversation

shbatm
Copy link
Contributor

@shbatm shbatm commented May 10, 2020

Proposed change

This is the 9th PR in a series (~10 total) to include migration to PyISYv2 and "modernization" of the isy994 integration based on testing done over the past year in the HACS custom component.

Full migration plan is captured in PR #35212

This PR adds several integration and entity services to expose commands and controls that are not available through other Home Assistant means, without calling custom REST commands and adding additional workarounds. This also allows a user to control devices that do not have full compatibility yet in Home Assistant (many Z-Wave device, like RGB bulbs). These services will also support future Device commands for being sent from the Frontend.

Services have been split into two categories--those that are called on entities that Home Assistant knows about are added as entity services, and those that call other ISY functions have been added at the integration level.

The following services are available:

  • isy994.send_raw_node_command: Send a "raw" ISY REST Device Command to a Node using its Home Assistant Entity ID.
  • isy994.send_node_command: Send a command to an ISY Device using its Home Assistant entity ID. Valid commands are: beep, brighten, dim, disable, enable, fade_down, fade_stop, fade_up, fast_off, fast_on, and query.
  • isy994.set_on_level: Send an ISY set_on_level command to a Node.
  • isy994.set_ramp_rate: Send an ISY set_ramp_rate command to a Node.
  • isy994.system_query: Request the ISY Query the connected devices.
  • isy994.set_variable: Set an ISY variable's current or initial value. Variables can be set by either type/address or by name.
  • isy994.send_program_command: Send a command to control an ISY program or folder. Valid commands are run, run_then, run_else, stop, enable, disable, enable_run_at_startup, and disable_run_at_startup.
  • isy994.run_network_resource: Run a network resource on the ISY.
  • isy994.reload: Reload the ISY994 connection(s) without restarting Home Assistant. Use to pick up new devices that have been added or changed on the ISY.
  • isy994.cleanup_entities: Cleanup old entities no longer used by the ISY994 integrations. Useful if you've removed devices from the ISY or changed the filter string options in the configuration to exclude additional items and they were not properly removed by Home Assistant.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

Tag: @bdraco @OverloadUT

shbatm added 4 commits May 10, 2020 12:26
ISY994 Add support for climate platform
Remove device registry cleanup from service in favor of #35106
Rename entry to config_entry_id
@probot-home-assistant
Copy link

Hey there @bdraco, mind taking a look at this pull request as its been labeled with a integration (isy994) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

homeassistant/components/isy994/services.py Outdated Show resolved Hide resolved
homeassistant/components/isy994/services.py Outdated Show resolved Hide resolved
homeassistant/components/isy994/services.py Outdated Show resolved Hide resolved
homeassistant/components/isy994/services.py Show resolved Hide resolved
@shbatm
Copy link
Contributor Author

shbatm commented May 11, 2020

Docs added.

Copy link
Member

@bdraco bdraco 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. @shbatm I want to at give @MartinHjelmare a chance to read your feedback in #35467 (comment) before merging

Copy link
Member

@bdraco bdraco 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. Thanks for the fixes as well

@bdraco bdraco merged commit 9eb1505 into home-assistant:dev May 11, 2020
@shbatm shbatm deleted the isy994_v2_pr9a branch May 11, 2020 16:26
rhadamantys pushed a commit to rhadamantys/home-assistant that referenced this pull request May 11, 2020
* ISY994 Add Services

ISY994 Add support for climate platform

* Remove device registry cleanup

Remove device registry cleanup from service in favor of home-assistant#35106

* ISY994 Update Services Definitions

Rename entry to config_entry_id

* Grammar corrections

Fix Typo

* Add await and lower logging per review.

* Rename to entries and remove unused device_id refs

* Fix tuple typo

* Fix Typo in strings

* Fix typo in strings
@lock lock bot locked and limited conversation to collaborators May 21, 2020
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.

4 participants