-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Fix xiaomi binary_sensor warning #18280
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
Conversation
Also fixes #17408 |
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.
This will fire the None
in the event. Just checking that this is intended :)
Indeed, that is not the intent. Infact, I was wondering why not use something like if value in ('vibrate', 'tilt', 'free_fall'):
self.hass.bus.fire('xiaomi_aqara.movement', {
'entity_id': self.entity_id,
'movement_type': value
})
self._last_action = value
return True
else:
return False Since the other events are useless for us anyways. |
Ok, I see. |
Yes, None is not a real movement and should be ignored |
If the sensor is being used to work in an environment where constant vibration is the desired and "normal" state. Wouldn't one want to know once vibration has paused and the sensor is now sampling no movement - "none"? |
@shishos The state reverts to Although, in my testing, the state is always |
Tested the code and it eliminates the noise in the logs. |
* Fix xiaomi binary_sensor warning * Fix xiaomi binary_sensor warning
Description:
Fix xiaomi binary_sensor warning
@arsaboo
Checklist:
tox
. Your PR cannot be merged unless tests passIf the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable ([example][ex-requir]).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.