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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alarm control panel support to ZHA #49080

Merged
merged 25 commits into from Apr 27, 2021

Conversation

dmulcahey
Copy link
Contributor

@dmulcahey dmulcahey commented Apr 11, 2021

Proposed change

This PR adds support for alarm control panel via Zigbee keypads to the ZHA integration.

alarm.mov

Screen Shot 2021-04-12 at 9 55 01 AM

Things left to do:

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

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

@project-bot project-bot bot moved this from Needs review to By Code Owner in Dev Apr 11, 2021
@Kane610
Copy link
Member

Kane610 commented Apr 12, 2021

Awesome! I'm in the process of doing this for deCONZ (#48736) as well, should we perhaps have a chat?

@dmulcahey dmulcahey marked this pull request as ready for review April 25, 2021 18:30
@Hedda
Copy link
Contributor

Hedda commented Apr 27, 2021

Does the ZHA integration documentation need to be updated so it also lists alarm control panels and/or IAS ACE device types?

There is currently support for the following device types within Home Assistant:

  • Alarm Control Panel (i.e. Zigbee IAS ACE devices like example keypads)
  • Binary Sensor
  • Climate (beta)
  • Cover
  • Fan
  • Light
  • Lock
  • Number (i.e. analog output)
  • Sensor
  • Switch

Also need to add "Alarm" to ha_category + "alarm" to ha_platforms so ZHA gets listed when filter the integrations?

https://www.home-assistant.io/integrations/#alarm

---
title: Zigbee Home Automation
description: Instructions on how to integrate your Zigbee Home Automation (ZHA) devices within Home Assistant.
ha_category:
  - Alarm
  - Hub
  - Binary Sensor
  - Climate
  - Fan
  - Light
  - Lock
  - Sensor
  - Switch
  - Cover
  - Number
ha_release: 0.44
ha_iot_class: Local Polling
featured: true
ha_config_flow: true
ha_codeowners:
  - '@dmulcahey'
  - '@adminiuga'
ha_domain: zha
ha_platforms:
  - alarm_control_panel
  - binary_sensor
  - climate
  - cover
  - device_tracker
  - fan
  - light
  - lock
  - sensor
  - switch
ha_zeroconf: true
---

@dmulcahey
Copy link
Contributor Author

Does the ZHA integration documentation need to be updated so it also lists alarm control panels and/or IAS ACE device types?

There is currently support for the following device types within Home Assistant:

  • Alarm Control Panel (i.e. Zigbee IAS ACE devices like example keypads)
  • Binary Sensor
  • Climate (beta)
  • Cover
  • Fan
  • Light
  • Lock
  • Number (i.e. analog output)
  • Sensor
  • Switch

Yes

Copy link
Contributor

@Adminiuga Adminiuga left a comment

Choose a reason for hiding this comment

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

LGTM

Dev automation moved this from By Code Owner to Reviewer approved Apr 27, 2021
@Adminiuga Adminiuga merged commit a644c2e into home-assistant:dev Apr 27, 2021
Dev automation moved this from Reviewer approved to Done Apr 27, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2021
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Please address the comments in a new PR. Thanks!

return IAS_ACE_STATE_MAP.get(self._channel.armed_state)

@property
def state_attributes(self):
Copy link
Member

Choose a reason for hiding this comment

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

This should be extra_state_attributes.

state_attr = {
ATTR_CODE_FORMAT: self.code_format,
ATTR_CHANGED_BY: self.changed_by,
ATTR_CODE_ARM_REQUIRED: self.code_arm_required,
Copy link
Member

Choose a reason for hiding this comment

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

These attributes are already handled by the base alarm control panel entity class. It's enough to implement the corresponding properties.

@dmulcahey
Copy link
Contributor Author

Will do. Thanks for the review!

@dmulcahey dmulcahey deleted the dm/zha-ias-ace-support branch December 18, 2021 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants