Send empty dictionary instead of null for iot queries (#1145)

This commit is contained in:
Steven B.
2024-10-01 12:47:36 +01:00
committed by GitHub
parent db80c383a9
commit 81e2685605
5 changed files with 8 additions and 7 deletions

View File

@@ -207,6 +207,8 @@ class IotDevice(Device):
def _create_request(
self, target: str, cmd: str, arg: dict | None = None, child_ids=None
):
if arg is None:
arg = {}
request: dict[str, Any] = {target: {cmd: arg}}
if child_ids is not None:
request = {"context": {"child_ids": child_ids}, target: {cmd: arg}}