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 custom bypass night arming to SIA alarm codes #95736

Merged

Conversation

etnoy
Copy link
Contributor

@etnoy etnoy commented Jul 2, 2023

Proposed change

Type of change

This PR was reviewed before as #80287 but never merged.

Within the SIA alarm codes (used in the Ajax alarm system) it is possible to arm with bypass. This is useful if a malfunction is detected but acknowledged by the user. However, if a malfunction is detected within night arming, the resulting state in HA will be Unknown. This change maps custom_bypass arming in night mode to armed_custom_byass.

Pinging @eavanvalkenburg

fixes #95279

  • 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 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.
  • 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:

@home-assistant
Copy link

home-assistant bot commented Jul 2, 2023

Hey there @eavanvalkenburg, mind taking a look at this pull request as it has been labeled with an integration (sia) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of sia can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign sia Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@etnoy etnoy changed the title Add custom bypass night arming Add custom bypass night arming to SIA alarm codes Jul 2, 2023
@eavanvalkenburg
Copy link
Contributor

LGTM

@etnoy
Copy link
Contributor Author

etnoy commented Jul 6, 2023

LGTM

Thanks, Eduard. How do we make sure this gets merged so it doesn't get abandoned like the last PR?

@gjohansson-ST
Copy link
Member

Would it not make more sense to make it STATE_ALARM_ARMED_CUSTOM_BYPASS even if it's night?

Please also rebase this PR to remove the unwanted commits.

@etnoy
Copy link
Contributor Author

etnoy commented Jul 10, 2023

Would it not make more sense to make it STATE_ALARM_ARMED_CUSTOM_BYPASS even if it's night?

Please also rebase this PR to remove the unwanted commits.

The SIA codes being added here are previously-unknown to HA. Night mode uses other codes as far I can tell from the Ajax docs

@gjohansson-ST
Copy link
Member

The SIA codes being added here are previously-unknown to HA. Night mode uses other codes as far I can tell from the Ajax docs

Sure, the new codes you are now mapping to STATE_ALARM_ARMED_NIGHT. I suggest you change that to STATE_ALARM_ARMED_CUSTOM_BYPASS even if it's during night (as you have explained the reasoning in the pr description)
Don't have a strong opinion here so if you guys prefer to keep it with STATE_ALARM_ARMED_NIGHT I'm fine with that.

@gjohansson-ST
Copy link
Member

@etnoy something is still not right with the rebase as there are now 140 commits on it.

@etnoy
Copy link
Contributor Author

etnoy commented Jul 10, 2023

@etnoy something is still not right with the rebase as there are now 140 commits on it.

Oh no. I just looked at "files changed" and was satisified. Ideally I'd just create a fresh branch from dev, but this seems hard now that it's part of a PR. Any suggestions? I feel like I've dug myself into a hole (the change is literally just two lines)

@gjohansson-ST
Copy link
Member

I suggest you open a new PR and close this one.
You can ping me in the new one.

@gjohansson-ST gjohansson-ST force-pushed the add-custom-bypass-night-arming branch from a0d14f9 to 9bff830 Compare July 20, 2023 12:29
@gjohansson-ST gjohansson-ST force-pushed the add-custom-bypass-night-arming branch from d225e77 to 678083e Compare July 20, 2023 12:37
@gjohansson-ST gjohansson-ST added this to the 2023.7.4 milestone Jul 20, 2023
@gjohansson-ST gjohansson-ST merged commit a381cee into home-assistant:dev Jul 20, 2023
@etnoy
Copy link
Contributor Author

etnoy commented Jul 20, 2023

Thanks for the assistance, @gjohansson-ST

@frenck frenck modified the milestones: 2023.7.4, 2023.7.3 Jul 20, 2023
frenck pushed a commit that referenced this pull request Jul 20, 2023
* Add SIA codes for night arming with custom bypass

* Set night custom bypass to ARMED_CUSTOM_BYPASS
@frenck frenck mentioned this pull request Jul 20, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2023
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.

Armed custom bypass for night mode showing as disarmed
4 participants