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

quirk for ts0603 garage door module #3607

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions zhaquirks/tuya/ts0603_garage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Tuya garage door opener."""

from zigpy.quirks.v2.homeassistant.binary_sensor import BinarySensorDeviceClass

from zhaquirks.tuya.builder import TuyaQuirkBuilder

(
TuyaQuirkBuilder("_TZE608_fmemczv1", "TS0603")
.tuya_onoff(dp_id=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would a button be more appropriate here?

Copy link
Author

Choose a reason for hiding this comment

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

Probably 😄 This is my first quirk so it wasn't easy. I've searched the repo and there aren't many examples of exposing entity as button in Homeassistant. Finally I "invented" something working and hopefully it is acceptable 😄

.tuya_binary_sensor(
dp_id=3,
device_class=BinarySensorDeviceClass.GARAGE_DOOR,
attribute_name="garage_door",
translation_key="garage_door",
fallback_name="Garage door",
)
.skip_configuration()
.add_to_registry()
)
Loading