@@ -30,7 +30,7 @@ async def create_standalone(
3030 response = await self ._client .post (
3131 url , json = {"name" : name , "site_id" : site_id , "slug" : slug }
3232 )
33- api .check_error (response )
33+ await api .check_error (response )
3434 return await self .get (device_id = response .json ()["device_id" ])
3535
3636 async def create_vucm (
@@ -47,7 +47,7 @@ async def create_vucm(
4747 response = await self ._client .post (
4848 url , json = {"name" : name , "hardware_id" : hardware_id , "site_id" : site_id }
4949 )
50- api .check_error (response )
50+ await api .check_error (response )
5151 return await self .get (
5252 device_id = response .json ()["device_id" ], expand_communication = True
5353 )
@@ -71,7 +71,7 @@ async def create_lua(
7171 "slug" : slug ,
7272 },
7373 )
74- api .check_error (response )
74+ await api .check_error (response )
7575 return await self .get (device_id = response .json ()["device_id" ])
7676
7777 async def get (
@@ -91,7 +91,7 @@ async def get(
9191 }
9292 expand_string = "," .join (k for k , v in expand .items () if v )
9393 response = await self ._client .get (url , params = {"expand" : expand_string })
94- api .check_error (response )
94+ await api .check_error (response )
9595 return Device .from_dto (response .json ()["device" ])
9696
9797 @async_ .generator
@@ -117,7 +117,7 @@ async def list(
117117 response = await self ._client .get (
118118 url , params = {"expand" : expand_string , "limit" : limit , "offset" : offset }
119119 )
120- api .check_error (response )
120+ await api .check_error (response )
121121 payload = response .json ()
122122 if not payload ["devices" ]:
123123 return
@@ -132,26 +132,26 @@ async def update(
132132 return await self .get (device_id )
133133 url = f"v3/devices/{ device_id } "
134134 response = await self ._client .patch (url , json = {"name" : name , "slug" : slug })
135- api .check_error (response )
135+ await api .check_error (response )
136136 return Device .from_dto (response .json ()["device" ])
137137
138138 async def delete (self , device_id : str ) -> None :
139139 url = f"v3/devices/{ device_id } "
140140 response = await self ._client .delete (url )
141- api .check_error (response )
141+ await api .check_error (response )
142142
143143 async def assign_blueprint (self , device_id : str , blueprint_id : str ) -> Device :
144144 url = f"v3/devices/{ device_id } /assign_blueprint"
145145 response = await self ._client .post (url , json = {"blueprint_id" : blueprint_id })
146- api .check_error (response )
146+ await api .check_error (response )
147147 return Device .from_dto (response .json ()["device" ])
148148
149149 async def generate_communication_config (
150150 self , device_id : str , mqtt_protocol : MQTTProtocol
151151 ) -> CommunicationConfig :
152152 url = f"v3/devices/{ device_id } /generate_config"
153153 response = await self ._client .post (url , json = {"protocol" : mqtt_protocol .value })
154- api .check_error (response )
154+ await api .check_error (response )
155155 return CommunicationConfig .from_dto (response .json ()["config" ])
156156
157157
0 commit comments