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
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: async def stream_source(self) -> str | None:
"""Return the source of the stream.""" """Return the source of the stream."""
return await self.hass.async_add_executor_job(
def _stream_source() -> str | None: self.device_manager.get_device_stream_allocate,
# This method can be replaced by the following snippet, once self.device.id,
# upstream changes have been merged. "rtsp",
#
# 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)
async def async_camera_image( async def async_camera_image(
self, width: int | None = None, height: int | None = None self, width: int | None = None, height: int | None = None

View File

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

View File

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

View File

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