Skip to content

Add alarm control panel support to ZHA#49080

Merged
Adminiuga merged 25 commits intohome-assistant:devfrom
dmulcahey:dm/zha-ias-ace-support
Apr 27, 2021
Merged

Add alarm control panel support to ZHA#49080
Adminiuga merged 25 commits intohome-assistant:devfrom
dmulcahey:dm/zha-ias-ace-support

Conversation

@dmulcahey
Copy link
Copy Markdown
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
Copy Markdown

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)

@Kane610
Copy link
Copy Markdown
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 force-pushed the dm/zha-ias-ace-support branch from f70db9d to 696e66d Compare April 12, 2021 13:03
@dmulcahey dmulcahey marked this pull request as ready for review April 25, 2021 18:30
@dmulcahey dmulcahey force-pushed the dm/zha-ias-ace-support branch from 55d9af4 to dd414c6 Compare April 25, 2021 18:55
@Hedda
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@Adminiuga Adminiuga merged commit a644c2e into home-assistant:dev Apr 27, 2021
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2021
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

None yet

Development

Successfully merging this pull request may close these issues.

6 participants