Pierre Ståhl
10e55e67b4
Add support for passive devices ( #171 )
...
* Add support for passive devices
* Fix a few issues
* Fix broken handling of closing a connection
This fixes the following error:
AttributeError: 'NoneType' object has no attribute 'write'
* Always use discovery broadcasts to trigger connects
From now on there's no connect loop but all attempts are initiated by
received discovery messages.
* Fix cancelling of heartbeat task
* Verify entry has been loaded before connecting
* Don't reset seqno when switching to type_d device
2020-12-15 09:08:46 +01:00
Pierre Ståhl
f376d8584a
Fix broken exception logging ( #173 )
2020-11-20 10:40:35 +01:00
Pierre Ståhl
0531a284c7
Add contextual logging where applicable ( #124 )
...
* Add contextual logging where applicable
* Compress device id in log output
2020-11-17 12:54:01 +01:00
ultratoto14
657850e39c
Add support of RGB lights ( #120 )
...
* Make set_dps available.
* Adding RGB support, brightness fix, color_temp range.
* Update README for light options
* Formatting
* Formatting
* Need to force to white to ensure color picker is updated.
* Detect color mode RGB/HSV based on color length.
* Extract rgb encoded color check in method.
* Make check method private.
* Fix exception when color is not available (maybe when powered off)
* Reformat.
2020-10-28 09:54:54 +01:00
Kendell R
c1878f82e2
Improve GitHub Actions ( #97 )
...
* Delete hassfest.yaml
* Update and rename ci.yaml to tox.yaml
* Create combined.yaml
* Update hacs.json
* Update README.md
* Update combined.yaml
* Remove unused import
* Restored wrongly deleted line in cover.py
* Update config_flow.py
* Update __init__.py
Co-authored-by: Pierre Ståhl <pierre.staahl@gmail.com >
Co-authored-by: rospogrigio <49229287+rospogrigio@users.noreply.github.com >
2020-10-22 11:43:47 +02:00
Pierre Ståhl
3f854337ad
Fix status exception when no payload
2020-10-21 12:09:06 +02:00
Pierre Ståhl
e6538a4681
Fix bugs in pytuya
...
This handles responses without a return code and also fixes support for
unencrypted clients. Made a few tweaks to debug logs as well.
2020-10-19 10:43:31 +02:00
Pierre Ståhl
47d2900a2c
Add set_dps to set multiple datapoints
2020-10-15 18:54:36 +02:00
Pierre Ståhl
44db913514
Rename set_dps to set_dp in pytuya
2020-10-15 18:54:36 +02:00
Pierre Ståhl
81c04bfc4e
Fix broken support for 0d devices
2020-10-15 18:48:34 +02:00
Pierre Ståhl
136e44c549
Minor final fixes
2020-10-14 13:10:20 +02:00
Pierre Ståhl
b0603313ff
Fixed some bugs
2020-10-14 13:10:20 +02:00
Pierre Ståhl
91f788865c
Add more temporary logging
2020-10-14 13:10:20 +02:00
Pierre Ståhl
ff3ca99b29
Add logging and stability fixes
2020-10-14 13:10:20 +02:00
Pierre Ståhl
7384f1fc54
Add context to pytuya logging
2020-10-14 13:10:20 +02:00
Pierre Ståhl
59dfc35759
Fix bug when unloading an entry
2020-10-14 13:10:20 +02:00
Pierre Ståhl
b2c4e93a47
Disconnect on missing heartbeats
2020-10-14 13:10:20 +02:00
Pierre Ståhl
f971646333
Close connection properly on error
2020-10-14 13:10:20 +02:00
Pierre Ståhl
2565074c9c
Add missing await
2020-10-14 13:10:20 +02:00
Pierre Ståhl
cad31f1ffe
Convert pytuya to asyncio
2020-10-14 13:10:20 +02:00
rospogrigio
2e46d65f9a
removing unused method after merge
2020-09-30 11:51:13 +02:00
rospogrigio
deeaf0e9eb
More lint fixes
2020-09-30 11:51:13 +02:00
rospogrigio
e5ce098016
More lint fixes
2020-09-30 11:51:13 +02:00
rospogrigio
56c266d344
Fixing lint output
2020-09-30 11:51:13 +02:00
rospogrigio
3fc19da259
Updating the status of TuyaDevice using the response of the set_dps() call
2020-09-30 11:51:13 +02:00
Pierre Ståhl
d9c6d66bb7
Fix review comments
2020-09-30 09:45:37 +02:00
Pierre Ståhl
b50cd7bf84
Initial work on refactoring pytuya
...
Still lots of things to improve, but it's a start. Will continue with
receive code.
2020-09-30 09:45:37 +02:00
Pierre Ståhl
b7173f3033
Switch to cryptograhy for crypto routines
2020-09-27 09:48:03 +02:00
Pierre Ståhl
02a2f08c40
Enable codespell and fix mistakes
2020-09-23 18:33:10 +02:00
Pierre Ståhl
4e72767b30
Fix flake8 issues and enable flake8 in tox
2020-09-23 17:50:24 +02:00
Pierre Ståhl
a18c69f8eb
Fix pydocstyle issues and enable in tox
2020-09-23 16:47:08 +02:00
Pierre Ståhl
30392d3ac5
Initial step to have continuous integration
...
This commit introduces the use of tox, which currently only verifies
that code is formatted according to the black project. More checks will
come in upcoming PRs for codespell, pydocstyle, flake8 and mypy.
A GitHub actions is included that runs tox on new pull requests, so we
get automatic feedback and can block commits that fail any check.
Another (official) action that runs hassfest is included as well, to
make sure we are compatible with Home Assistant.
2020-09-22 12:29:05 +02:00
rospogrigio
83b3b6f21b
Moved TuyaCache to __init__.py, and renamed to TuyaDevice. In pytuya, renamed TuyaDevice to TuyaInterface
2020-09-22 00:51:33 +02:00
rospogrigio
c266e0f904
add_request_dps moved into prepare_setup_entities, plus code cleaning
2020-09-19 15:59:59 +02:00
rospogrigio
6700e02c52
set_dpsUsed turned into add_dps_to_request ; used it when setting up entities
2020-09-19 15:59:59 +02:00
rospogrigio
16cb29297b
Introduced dps detection with bruteforcing for type_0d devices
2020-09-16 19:36:51 +02:00
rospogrigio
c99cc1f077
Removed unneeded friendly_name fields
2020-09-15 23:31:33 +02:00
rospogrigio
22ccd51926
Fixed TuyaDevice init calls
2020-09-15 09:24:53 +02:00
rospogrigio
6c68cdcbcc
Merge branch 'pytuya_refactoring' into physical_device
2020-09-15 00:15:46 +02:00
rospogrigio
47b92b0178
Fixes suggested in PR #11
2020-09-13 14:03:08 +02:00
rospogrigio
c008339f43
First working implementation of Devices
2020-09-11 14:48:49 +02:00
rospogrigio
184199ef87
Pytuya library refactoring and code cleaning
2020-09-11 11:46:01 +02:00
rospogrigio
8e9fb82304
Introduced type_0a and type_0d devices autodetection
2020-09-10 10:59:58 +02:00
rospogrigio
63d1ef26d4
Cleaned up pytuya code
2020-09-07 14:46:35 +02:00
rospogrigio
2f50050f8a
Merge branch 'master' of https://github.com/fancygaphtrn/localtuya-homeassistant into fancygaphtrn-master
2020-09-04 22:36:16 +02:00
fancygaphtrn
8ae6a71797
Updated to be inline with upstream 7.0.9
2020-09-04 10:01:07 -04:00
rospogrigio
16d8d4dcf9
Introduced pytuya 7.0.9: Unified dev_type (device20 or device22) handling for all devices
2020-09-03 21:51:27 +02:00
rospogrigio
98508a347a
v.1.0.1: sending only dps actually used in request payload
2020-08-06 11:32:33 +02:00
fancygaphtrn
87a0ac2363
Fan support
2020-06-30 07:23:14 -04:00
rospogrigio
db03bd3a8d
Updated for HA 110.0 (CoverEntity and SwitchEntity instead of CoverDevice and SwitchDevice)
2020-05-21 07:55:35 +02:00