- 
                Notifications
    
You must be signed in to change notification settings  - Fork 22
 
Open
Description
it looks as though storing result as a const on line 224 does so within the scope of the try/catch instead of the variable initially instantiated on 212. Removing const and modifying the line to be
result = await axios.post(`${this.baseUrl}/app/v2/device/set_property`, await this.getRequestBodyData(data))
seems to fix the issue.
Lines 211 to 231 in c16d427
| async setProperty(deviceMac, deviceModel, propertyId, propertyValue) { | |
| let result | |
| try { | |
| await this.getTokens(); | |
| if (!this.accessToken) { | |
| await this.login() | |
| } | |
| const data = { | |
| device_mac: deviceMac, | |
| device_model: deviceModel, | |
| pid: propertyId, | |
| pvalue: propertyValue, | |
| } | |
| const result = await axios.post(`${this.baseUrl}/app/v2/device/set_property`, await this.getRequestBodyData(data)) | |
| } catch (e) { | |
| console.log('Error...', e) | |
| throw e | |
| } | |
| return result.data | |
| } | 
Metadata
Metadata
Assignees
Labels
No labels