Skip to content

Commit 1acbe5b

Browse files
committed
Make it possible to wait for action via detailed response type
1 parent d81767b commit 1acbe5b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

wmspro/action.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from .const import (
33
WMS_WebControl_pro_API_actionType,
44
WMS_WebControl_pro_API_actionDescription,
5+
WMS_WebControl_pro_API_responseType,
56
)
67

78

@@ -61,15 +62,16 @@ def __getattr__(self, name: str) -> Any:
6162
def __getitem__(self, name: str) -> Any:
6263
return self._params.get(name)
6364

64-
async def __call__(self, **kwargs) -> Any:
65+
async def __call__(self, responseType=WMS_WebControl_pro_API_responseType.Instant, **kwargs) -> Any:
6566
return await self._dest._control._action(
6667
actions=[
6768
{
6869
"destinationId": self._dest.id,
6970
"actionId": self.id,
7071
"parameters": kwargs,
7172
}
72-
]
73+
],
74+
responseType=responseType,
7375
)
7476

7577
def diag(self) -> dict:

wmspro/webcontrol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ async def async_main_test():
154154
WMS_WebControl_pro_API_actionType.Percentage,
155155
)
156156
print(action)
157-
response = await action(percentage=0)
157+
response = await action(percentage=0, responseType=WMS_WebControl_pro_API_responseType.Detailed)
158158
print(response)
159159

160160
pprint.pprint(control.diag())

0 commit comments

Comments
 (0)