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

support Xiaomi Occupancy(Human Presence) Sensor XMOSB01XS #91

Closed
wants to merge 1 commit into from
Closed

Conversation

ldfandian
Copy link
Contributor

Support 2024 New battery based Xiaomi Mijia Occupancy (Human Presence) Sensor (XMOSB01XS)

New test cases are added.
Also verified by adding it to Home Assistant (with a small additional changes in xiaomi-ble component for additional new properties)

Hardware Info:

WX20240828-004303@2x

Support 2024 New battery based Xiaomi Mijia Occupancy (Human Presence) Sensor (XMOSB01XS)

New test cases are added.
Also verified by adding it to Home Assistant (with a small additional changes in xiaomi-ble component for additional new properties)

Hardware Info:

https://www.aliexpress.com/i/1005007104780534.html
https://www.mi.com/shop/buy/detail?product_id=19994
@ldfandian ldfandian closed this Aug 27, 2024
def obj484e(
xobj: bytes, device: XiaomiBluetoothDeviceData, device_type: str
) -> dict[str, Any]:
"""Occupancy-status: uint8: 0 - No One, 1 - Has One"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Occupancy-status: uint8: 0 - No One, 1 - Has One"""
"""Occupancy-status: uint8: 0 - Clear, 1 - Detected"""

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok~

@@ -80,3 +80,9 @@ class ExtendedSensorDeviceClass(BaseDeviceClass):

# Toothbrush score
SCORE = "score"

# Has-Someone-Duration
HAS_SOMEONE_DURATION = "has_someone_duration"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would use something like
duration someone detected and duration clear

Copy link
Collaborator

@Ernst79 Ernst79 left a comment

Choose a reason for hiding this comment

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

Thanks. I added some small suggestions.

Please name your commit something like
feat: add occupancy sensor

All lower case letters. That should make the lint commit test pass

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