Conversation
|
Also fixes #17408 |
amelchio
left a comment
There was a problem hiding this comment.
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 FalseSince 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:
REQUIREMENTSvariable ([example][ex-requir]).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.