From 47d2900a2cefb6fd1fbd05158afb9cb8bce3b618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20St=C3=A5hl?= Date: Wed, 14 Oct 2020 22:31:30 +0200 Subject: [PATCH] Add set_dps to set multiple datapoints --- custom_components/localtuya/pytuya/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/localtuya/pytuya/__init__.py b/custom_components/localtuya/pytuya/__init__.py index 81de56a..f1657f8 100644 --- a/custom_components/localtuya/pytuya/__init__.py +++ b/custom_components/localtuya/pytuya/__init__.py @@ -438,6 +438,10 @@ class TuyaProtocol(asyncio.Protocol): """ return await self.exchange(SET, {str(dp_index): value}) + async def set_dps(self, value, dps): + """Set values for a set of datapoints.""" + return await self.exchange(SET, dps) + async def detect_available_dps(self): """Return which datapoints are supported by the device.""" # type_0d devices need a sort of bruteforce querying in order to detect the