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 TRIGGERcmd integration #121268

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open

Add TRIGGERcmd integration #121268

wants to merge 22 commits into from

Conversation

rvmey
Copy link

@rvmey rvmey commented Jul 5, 2024

Breaking change

Proposed change

Add the new triggercmd integration.

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format 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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @rvmey

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

home-assistant bot commented Jul 5, 2024

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@rvmey
Copy link
Author

rvmey commented Jul 5, 2024

I don't know what "Collect information & changes data Expected — Waiting for status to be reported" means.

Do I need to provide that data and report status somehow?

@cgarwood
Copy link
Member

cgarwood commented Jul 5, 2024

GitHub won't run most workflows on a PR for a first-time contributor to a repository (to protect against people abusing their workflow runners for crypto mining/scams). I believe after someone gets their first PR merged, workflows will then run automatically in the future.

I went ahead and triggered the workflows to run 🙂

Copy link
Member

@cgarwood cgarwood left a comment

Choose a reason for hiding this comment

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

Couple initial review comments...

homeassistant/components/triggercmd/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/hub.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/hub.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/hub.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/config_flow.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft July 5, 2024 15:46
@rvmey rvmey marked this pull request as ready for review July 9, 2024 01:05
@home-assistant home-assistant bot requested a review from cgarwood July 9, 2024 01:05
homeassistant/components/triggercmd/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/switch.py Show resolved Hide resolved
homeassistant/components/triggercmd/switch.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/switch.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/switch.py Show resolved Hide resolved
self._switch.remove_callback(self.async_write_ha_state)

@property
def device_info(self) -> DeviceInfo:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with triggercmd but from the variable names I think we should create a device per computer

Copy link
Author

Choose a reason for hiding this comment

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

I considered that, but I decided each triggercmd trigger should be represented as a device because the Alexa, Google Assistant, and SmartThings integrations create a virtual on/off switch device for each trigger. It makes it easier to educate triggercmd users if the integrations work similarly. I hope that's ok.

Copy link
Contributor

@edenhaus edenhaus Aug 2, 2024

Choose a reason for hiding this comment

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

Nope, we should create one device per computer so all triggers of one computer are grouped in the UI, too.
A device includes additional features like disabling a device, which will also disable all entities for that device. It's common for users to disable devices for a certain time of the year (ex. Disable the sprinkler during the winter)

@home-assistant home-assistant bot marked this pull request as draft July 19, 2024 16:38
@rvmey rvmey marked this pull request as ready for review July 24, 2024 00:30
@home-assistant home-assistant bot requested a review from edenhaus July 24, 2024 00:30
homeassistant/components/triggercmd/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/hub.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/hub.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/strings.json Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/switch.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/switch.py Outdated Show resolved Hide resolved
homeassistant/components/triggercmd/hub.py Outdated Show resolved Hide resolved
tests/components/triggercmd/test_config_flow.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft August 2, 2024 13:31
@rvmey rvmey marked this pull request as ready for review August 3, 2024 21:05
@home-assistant home-assistant bot requested a review from edenhaus August 3, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants