tuya-iot-python-sdk icon indicating copy to clipboard operation
tuya-iot-python-sdk copied to clipboard

Wrong endpoint url used in get_device_status implementation

Open tyge68 opened this issue 2 years ago • 0 comments

Currently to get the device status according to Tuya developer API documentation (1) , it need the suffix '/status' Without that suffix it uses another endpoint for device details, which won't return the status for some type of devices (could be also an issue at Tuya itself with 'sub devices').

https://github.com/tuya/tuya-iot-python-sdk/blob/main/tuya_iot/device.py#L592 Fix could be following

    def get_device_status(self, device_id: str) -> dict[str, Any]:
        return self.api.get(f"/v1.0/devices/{device_id}/status")

(1) https://eu.iot.tuya.com/cloud/explorer?id=p1672264192429jq7u3m&groupId=group-home&interfaceId=470224763027537

tyge68 avatar Jan 18 '23 07:01 tyge68