Skip to content

Comments

Add OccupancySensing PIR delay entities#669

Draft
TheJulianJES wants to merge 4 commits intozigpy:devfrom
TheJulianJES:tjj/pir_delay_number_config_entities
Draft

Add OccupancySensing PIR delay entities#669
TheJulianJES wants to merge 4 commits intozigpy:devfrom
TheJulianJES:tjj/pir_delay_number_config_entities

Conversation

@TheJulianJES
Copy link
Contributor

@TheJulianJES TheJulianJES commented Feb 21, 2026

DRAFT. TODO: Translations in HA!

Proposed change

This adds config number entities for the OccupancySensing pir_o_to_u_delay and pir_u_to_o_delay attributes.
The entity class for the Sonoff sensors (ultrasonic_o_to_u_delay) is also moved to be near below the PIR delay classes.

Additional information

This would avoid introducing quirks v2 entities, e.g. for the Hue sensors or the Frient sensor below:

IIRC there was an issue with Hue sensors returning this attribute was unsupported during pairing, but maybe that was only an issue because of the manufacturer code stuff we had going on. I'll need to recheck that.

Sonoff specific entity – ultrasonic_o_to_u_delay

In the future, we may wanna look at exposing that entity for all devices, just with the limits removed.
All these entities will end up using the BOX NumberMode in HA anyway (where you can even enter numbers outside min/max IIRC), so these limits are more artificial.

TODO: Also look at attributes in SonoffPresenceSenorTimeout (device class + unit of measurement + unnecessary attributes).

@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.45%. Comparing base (aa03919) to head (6814d30).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #669   +/-   ##
=======================================
  Coverage   97.44%   97.45%           
=======================================
  Files          62       62           
  Lines       10731    10752   +21     
=======================================
+ Hits        10457    10478   +21     
  Misses        274      274           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmulcahey
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants