Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
pipx install tinytuya
as raised by @felipecrs in https://github.com/jasonacox/tinytuya/issues/500 allowing for easier CLI use.tinytuya
by itself will now produce a "Usage" page instead of running a scan. Use tinytuya scan
or python -m tinytuya scan
.# Install CLI tool with pipx
pipx install tinytuya
tinytuya scan
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.13.2...v1.14.0
Published by jasonacox 8 months ago
Contrib/__init__.py
by @uzlonewolf in https://github.com/jasonacox/tinytuya/pull/466
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.13.1...v1.13.2
Published by jasonacox 12 months ago
tools/fake-v35-device.py
script to toolsFull Changelog: https://github.com/jasonacox/tinytuya/compare/v1.13.0...v1.13.1
Published by jasonacox 12 months ago
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.11...v1.13.0
Published by jasonacox about 1 year ago
_get_socket()
exception handling for device offline conditions. See #402 .Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.10...v1.12.11
Published by jasonacox about 1 year ago
connection_retry_limit
) and socketRetryDelay (connection_retry_limit
) to Device constructor args.Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.9...v1.12.10
Published by jasonacox over 1 year ago
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+
error. See https://github.com/jasonacox/tinytuya/issues/377 & https://github.com/jasonacox/tinytuya/pull/379.devices.json
versions as raised in https://github.com/jasonacox/tinytuya/issues/381 & https://github.com/jasonacox/tinytuya/pull/382
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.8...v1.12.9
Published by jasonacox over 1 year ago
Example device from UPDATED devices.json
showing new "mapping" data:
{
"name": "Smart Plug",
"id": "01234567890abcdef012",
"key": "abcdef0123456789",
"mac": "aa:bb:cc:dd:33:11",
"uuid": "01234567890abcdef012",
"category": "cz",
"product_name": "WP1-Smart Socket",
"product_id": "iXfg9AQVUPhlfyGw",
"biz_type": 18,
"model": "WP1/10A/\u5e26\u8ba1\u91cf/gosund",
"sub": false,
"icon": "https://images.tuyaus.com/smart/icon/1472009231_0.png",
"mapping": {
"1": {
"code": "switch",
"type": "Boolean",
"values": {}
},
"4": {
"code": "cur_current",
"type": "Integer",
"values": {
"unit": "mA",
"min": 0,
"max": 30000,
"scale": 0,
"step": 1
}
},
"5": {
"code": "cur_power",
"type": "Integer",
"values": {
"unit": "W",
"min": 0,
"max": 50000,
"scale": 1,
"step": 1
}
},
"6": {
"code": "cur_voltage",
"type": "Integer",
"values": {
"unit": "V",
"min": 0,
"max": 5000,
"scale": 1,
"step": 1
}
},
"2": {
"code": "countdown_1",
"type": "Integer",
"values": {
"unit": "s",
"min": 0,
"max": 86400,
"scale": 0,
"step": 1
}
}
},
"ip": "10.20.30.40",
"version": "3.1"
}
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.7...v1.12.8
Published by jasonacox over 1 year ago
detect_available_dps()
to resolve issue where status()
call for smartbulbs would randomly cause devices to turn off by @xgustavoh in https://github.com/jasonacox/tinytuya/pull/345
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.6...v1.12.7
Published by jasonacox over 1 year ago
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.5...v1.12.6
Published by jasonacox over 1 year ago
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.4...v1.12.5
Published by jasonacox over 1 year ago
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.3...v1.12.4
Published by jasonacox over 1 year ago
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.2...v1.12.3
Published by jasonacox over 1 year ago
subdev_query()
added by @uzlonewolf in https://github.com/jasonacox/tinytuya/pull/308
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.1...v1.12.2
Published by jasonacox over 1 year ago
sendcommand()
parameter for URI by @Syrooo in https://github.com/jasonacox/tinytuya/pull/303
_get_all_devices()
and _update_device_list()
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.12.0...v1.12.1
Published by jasonacox over 1 year ago
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.11.0...v1.12.0
Published by jasonacox over 1 year ago
tuya-raw.json
(backward compatible).Additional data in tuya-raw.json:
"file": {
"name": "tuya-raw.json",
"description": "Full raw list of Tuya devices.",
"account": "xxxxxxxxxxxxxxxxxxxx",
"date": "2023-03-04T19:50:08.879865",
"tinytuya": "1.11.0"
}
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.10.3...v1.11.0
Published by jasonacox over 1 year ago
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.10.2...v1.10.3
Published by jasonacox over 1 year ago
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.10.1...v1.10.2
Published by jasonacox over 1 year ago
_process_message()
missing parameters discovered via issue https://github.com/jasonacox/tinytuya/issues/266 by @jasonacox in https://github.com/jasonacox/tinytuya/pull/267
set_colour()
, set_hsv()
and set_colourtemp()
as some devices do not correctly report capabilities. Conditional provides debug warning message instead by @jasonacox in https://github.com/jasonacox/tinytuya/issues/265
Full Changelog: https://github.com/jasonacox/tinytuya/compare/v1.10.0...v1.10.1