Upgrade Tuya IoT Python SDK to 0.6.3 (#58240)

This commit is contained in:
Franck Nijhof 2021-10-25 12:09:54 +02:00 committed by GitHub
parent ef48238ac3
commit 21709e7170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 34 deletions

View File

@ -81,26 +81,11 @@ class TuyaCameraEntity(TuyaEntity, CameraEntity):
async def stream_source(self) -> str | None:
"""Return the source of the stream."""
def _stream_source() -> str | None:
# This method can be replaced by the following snippet, once
# upstream changes have been merged.
#
# return self.device_manager.get_device_stream_allocate(
# self.device.id, stream_type="rtsp"
# )
#
# https://github.com/tuya/tuya-iot-python-sdk/pull/28
response = self.device_manager.api.post(
f"/v1.0/devices/{self.device.id}/stream/actions/allocate",
{"type": "rtsp"},
)
if response["success"]:
return response["result"]["url"]
return None
return await self.hass.async_add_executor_job(_stream_source)
return await self.hass.async_add_executor_job(
self.device_manager.get_device_stream_allocate,
self.device.id,
"rtsp",
)
async def async_camera_image(
self, width: int | None = None, height: int | None = None

View File

@ -2,22 +2,22 @@
"domain": "tuya",
"name": "Tuya",
"documentation": "https://www.home-assistant.io/integrations/tuya",
"requirements": ["tuya-iot-py-sdk==0.5.0"],
"requirements": ["tuya-iot-py-sdk==0.6.3"],
"dependencies": ["ffmpeg"],
"codeowners": ["@Tuya", "@zlinoliver", "@METISU", "@frenck"],
"config_flow": true,
"iot_class": "cloud_push",
"dhcp": [
{"macaddress": "105A17*"},
{"macaddress": "10D561*"},
{"macaddress": "1869D8*"},
{"macaddress": "381F8D*"},
{"macaddress": "508A06*"},
{"macaddress": "68572D*"},
{"macaddress": "708976*"},
{"macaddress": "7CF666*"},
{"macaddress": "84E342*"},
{"macaddress": "D4A651*"},
{"macaddress": "D81F12*"}
{ "macaddress": "105A17*" },
{ "macaddress": "10D561*" },
{ "macaddress": "1869D8*" },
{ "macaddress": "381F8D*" },
{ "macaddress": "508A06*" },
{ "macaddress": "68572D*" },
{ "macaddress": "708976*" },
{ "macaddress": "7CF666*" },
{ "macaddress": "84E342*" },
{ "macaddress": "D4A651*" },
{ "macaddress": "D81F12*" }
]
}

View File

@ -2323,7 +2323,7 @@ tp-connected==0.0.4
transmissionrpc==0.11
# homeassistant.components.tuya
tuya-iot-py-sdk==0.5.0
tuya-iot-py-sdk==0.6.3
# homeassistant.components.twentemilieu
twentemilieu==0.3.0

View File

@ -1333,7 +1333,7 @@ total_connect_client==0.57
transmissionrpc==0.11
# homeassistant.components.tuya
tuya-iot-py-sdk==0.5.0
tuya-iot-py-sdk==0.6.3
# homeassistant.components.twentemilieu
twentemilieu==0.3.0