Open rohbags opened 2 years ago
I haven't dug into the code at all, but for what is worth, I currently have pir motion sensors and door contact sensors working with localtuya 4.0.0. Took a bit of trial and error to pair them but got them to work in the end, simply by making sure I was triggering them as I was running the config flow. (https://github.com/rospogrigio/localtuya/issues/770).
The problem I'm having right now with the motion sensors is they're taking considerably longer to update using localtuya (5-6 secs) then via the cloud (1-3 secs), so would love to see this improved. That being said, I otherwise love this integration, so kudos to all the developers behind it. It's made my lights and switches respond significantly faster than before, almost instantaneously tbh, which makes it all the more confusing to understand why it's the opposite with the motion detectors.
Any plans to re-add passive device support? I have a number of tuya-based door/window sensors that will turn off 3 seconds after sending an update to HA, as well as motion sensors that act the same way. For the last couple of years I have been manually changing the localtuya code to support this, but after updating to 3.5 from 3.2 today there are significant changes. Instead of re-writing everything again, can we add this to the main repo?
Previously in common.py I have this in class LocalTuyaEntity:
` async def async_added_to_hass(self): """Subscribe localtuya events.""" await super().async_added_to_hass()
In 3.5 I have started with this, but have not added the section after async_dispatcher_connect(...) because the flow of the first part is not right:
` async def async_added_to_hass(self): """Subscribe localtuya events.""" await super().async_added_to_hass()
`
In config_flow.py I have also added
vol.Required(CONF_PASSIVE_DEVICE, default=False): bool,
to BASIC_INFO_SCHEMA, DEVICE_SCHEMA and options_schema ... return vol.Schema(){ ... }) as well as CONF_DEVICE_PASSIVE to .const import, and the necessary changes to init.pyWhy was passive device support removed at all?