From 00b64e33c2b1a74e48d662dc176a4a035182f7eb Mon Sep 17 00:00:00 2001 From: cyrilp <5814027+CyrilP@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:24:40 +0100 Subject: [PATCH] =?UTF-8?q?=C2=A0fix=20ruff=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/deltadore-tydom/tydom/tydom_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/deltadore-tydom/tydom/tydom_client.py b/custom_components/deltadore-tydom/tydom/tydom_client.py index c0ecc9b..30ac648 100644 --- a/custom_components/deltadore-tydom/tydom/tydom_client.py +++ b/custom_components/deltadore-tydom/tydom/tydom_client.py @@ -492,7 +492,7 @@ async def put_data(self, path, name, value): body: str if value is None: body = '{"' + name + '":"null}' - elif type(value)==bool or type(value)==int: + elif isinstance(value, bool) or isinstance(value, int): body = '{"' + name + '":"' + str(value).lower() + '}' else: body = '{"' + name + '":"' + value + '"}' @@ -516,7 +516,7 @@ async def put_devices_data(self, device_id, endpoint_id, name, value): body: str if value is None: body = '[{"name":"' + name + '","value":null}]' - elif type(value)==bool: + elif isinstance(value, bool): body = '[{"name":"' + name + '","value":' + str(value).lower() + '}]' else: body = '[{"name":"' + name + '","value":"' + value + '"}]'