-
Notifications
You must be signed in to change notification settings - Fork 729
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 attributes for ThirdReality nightlight 3RSNL02043Z
#3276
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #3276 +/- ##
==========================================
+ Coverage 88.18% 88.26% +0.07%
==========================================
Files 301 302 +1
Lines 9412 9440 +28
==========================================
+ Hits 8300 8332 +32
+ Misses 1112 1108 -4 ☔ View full report in Codecov by Sentry. |
d3e9b13
to
0e4cb16
Compare
Can you describe what these attributes do? |
Hi, |
Right, that's clear from the names of the attributes.
|
Hi, puddly. This is a multifunction device and It contains light, pir sensor, and illuminance sensor.
|
4700bff
to
dde7d28
Compare
Copy that, thank you. |
OK. Got it. I'm sorrry about this mistake and will definitely pay attention next time. Thanks. |
Change-Id: I136b856588fb42e69274b899cdafa3c5e9ce819f
All good! By the way, you don't need to squash and force push your commits every time. You can just add another commit changing things. The whole PR will be squashed automatically when merging, so no need to do it manually before. |
Okay, I will understand and use it next time. Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be fine for now, since it just adds the custom attribute definitions.
In the future, we can think about replacing the Nightlight
/CustomDevice
v1 quirk with a v2 quirk that could look something like this:
(
QuirkBuilder(THIRD_REALITY, "3RSNL02043Z")
.replaces(LocalIasZone)
.replaces(ThirdRealitySpecificCluster)
.number(
ThirdRealitySpecificCluster.AttributeDefs.cooldown_time.name,
ThirdRealitySpecificCluster.cluster_id,
min_value=0, # change
max_value=100, # change
step=1, # change
unit="s", # change?
)
.number(
ThirdRealitySpecificCluster.AttributeDefs.local_routine_time.name,
ThirdRealitySpecificCluster.cluster_id,
min_value=0, # change
max_value=100, # change
step=1, # change
unit="s", # change
)
.number(
ThirdRealitySpecificCluster.AttributeDefs.lux_threshold.name,
ThirdRealitySpecificCluster.cluster_id,
min_value=0, # change
max_value=100, # change
step=1, # change
unit="s", # change
)
.add_to_registry()
)
(untested and unfinished code above, just a quick draft)
It would allow users to configure the custom attributes from entities in HA. Translation keys will also need to be added to HA, but we should do that in the quirks/ZHA bump PR.
To confirm, @puddly, you're also good with this PR for now?
3RSNL02043Z
Yeah, there's nothing new, it's just mapping attributes. A followup PR should expose them as entities. |
Change-Id: I136b856588fb42e69274b899cdafa3c5e9ce819f
Proposed change
Additional information
Checklist
pre-commit
checks pass / the code has been formatted using Black