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 + '"}]'