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 more zwave_js binary sensor descriptions #59474

Merged
merged 3 commits into from Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions homeassistant/components/zwave_js/binary_sensor.py
Expand Up @@ -148,6 +148,13 @@ class PropertyZWaveJSEntityDescription(
states=("1", "2", "3", "4"),
device_class=DEVICE_CLASS_LOCK,
),
NotificationZWaveJSEntityDescription(
# NotificationType 6: Access Control - State Id's 11 (Lock jammed)
key=NOTIFICATION_ACCESS_CONTROL,
states=("11",),
device_class=DEVICE_CLASS_PROBLEM,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
NotificationZWaveJSEntityDescription(
# NotificationType 6: Access Control - State Id 22 (door/window open)
key=NOTIFICATION_ACCESS_CONTROL,
Expand Down Expand Up @@ -189,6 +196,14 @@ class PropertyZWaveJSEntityDescription(
device_class=DEVICE_CLASS_PLUG,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
NotificationZWaveJSEntityDescription(
# NotificationType 8: Power Management -
# State Id's 6, 7, 8, 9 (power status)
key=NOTIFICATION_POWER_MANAGEMENT,
states=("6", "7", "8", "9"),
device_class=DEVICE_CLASS_SAFETY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
NotificationZWaveJSEntityDescription(
# NotificationType 8: Power Management -
# State Id's 10, 11, 17 (Battery maintenance status)
Expand All @@ -198,10 +213,11 @@ class PropertyZWaveJSEntityDescription(
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
NotificationZWaveJSEntityDescription(
# NotificationType 9: System - State Id's 1, 2, 6, 7
# NotificationType 9: System - State Id's 1, 2, 3, 4, 6, 7
key=NOTIFICATION_SYSTEM,
states=("1", "2", "6", "7"),
states=("1", "2", "3", "4", "6", "7"),
Copy link
Member

Choose a reason for hiding this comment

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

was your addition of state id's 3 and 4 intended ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, these should also work as binary sensors even if the event contains some extra parameters with failure codes.

device_class=DEVICE_CLASS_PROBLEM,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
NotificationZWaveJSEntityDescription(
# NotificationType 10: Emergency - State Id's 1, 2, 3
Expand Down