Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@CloCkWeRX
Copy link

@CloCkWeRX CloCkWeRX commented Feb 5, 2025

Fix #1854
Fix #781

It took about an hour to merge, the only areas that need to be resolved as conflicts are versions, README and some translations.

Most relevant commits are the last 30.

This is @xZetsubou's branch plus a handful of other PRs for this repo.
Running locally for the past few days, a few devices going offline without logs; so TUYA protocol changes probably need to be double checked for merge conflicts.

1x failing test that is a merge conflict most likely.

xZetsubou and others added 30 commits August 30, 2024 11:22
The order list should be always a list of speeds which will always will be sent as string, otherwise set rely on min/max and send as intgeer.
* Call disconnect() only once

* Typo error in a comment
…int' (rospogrigio#345)

* TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

* amended absed on review
* Variable is not used anymore

* Variable was never used
* Unused parameter of "private" method

* Use main thread loop

* Don't reconnect to offline device much too often

* _shutdown_entities shall do its job on closing

* Delay _shutdown_entities with a sleep

* Git rid of call_later logic
* Don't update seqno from a delayed reply

* black format

---------

Co-authored-by: Bander <[email protected]>
* Bug fix: self.transport shall not be None!

* Simplify condition

Co-authored-by: Bander <[email protected]>

---------

Co-authored-by: Bander <[email protected]>
* Eliminated unneeded self.heartbeater.cancel()

* Logical order of actions

* Direct call instead of await

* Wait for async tasks to finish on close
Fixing typo of "Sielnt" to "Silent"
* Bug fix: self.transport shall not be None!

* Make TuyaProtocol.close waiting for activity stopped

* TuyaDevice.close() closes its sub-devices, if any.

* Different way to close devices on unload.

* Close devices on HA shutdown

* Fix: async coroutine shall be awaited

* Similar to rospogrigio#368

* Proposals by xZetsubou
* Eliminated _call_on_close, which was growing without a control

* Different cancellation order

* Clear the task on return

* Typo in the comment

* Clear after use

* Useless parameter

* Interruptable sleep

* Stop the previous _shutdown_entities and start a new one.

* Force debug logging of sleep cancel event

* Comment

* Fix mistaken edit

* Calling _shutdown_entities() in close() is not required.

* Early interrupt of _connect_subdevices

* Group cancel of async tasks

* Close detached sub-devices and faster close of sub-devices

* _sleep() actually is not required (anymore?)

* Don't remove sub-devices from its gateway's container

* Don't rely on disconnect(): _unsub_refresh in close()

* Don't count "absent" events as "offline" events

* try block around _async_reconnect loop body

* try block in _shutdown_entities

* More on cancel handling in _make_connection

* cleans up and missed expection 
* Merged abort connection w/ pending tasks.
* added cancled asyncio in pytuya connect.
* rename subdevice_state var/func

---------

Co-authored-by: Bander <[email protected]>
* abort_connect() shall be called at the end: revert rospogrigio#383 abort interface close before sub-devices

* subdevice_state_updated calls

* Prevent out of order commands

* Better serialization of writes

* Check for _is_closing before going to sleep
* fix: i/o blocking function of templates
* disconnect on disable

* Entry will automatic reload after 30secs either way.

* cleans up
* Inlucde sub-devices on disable disconnection

* Fillter out closed subdevices from GW

* docstring
* add possibilty to add manual dps in reconfigure step
CloCkWeRX and others added 30 commits April 24, 2025 22:51
* Add basic devcontainer

* Add contributing doc

* Update CONTRIBUTING.md
* Handle 0 values for sub sensors

* none as default value for getattr

* add qccdz category
related: 658
* Adding support for sending raw IR codes when device is not specified, in order to enable other components like SmartIR to send codes they store on their end.

* Addressing comments to keep device mandatory
and add special "raw_b64" device type for raw commands.
* Check and ignore fire event if no listeners

* remove debugging log
* Remove battery attr from vacuum

* remove battery test
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.

Bring on more devs Explore ways to decrease maintenance burden