Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong endpoint url used in get_device_status implementation #71

Open
tyge68 opened this issue Jan 18, 2023 · 0 comments
Open

Wrong endpoint url used in get_device_status implementation #71

tyge68 opened this issue Jan 18, 2023 · 0 comments

Comments

@tyge68
Copy link

tyge68 commented Jan 18, 2023

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 tyge68 changed the title Wrong url in get_device_status implementation Wrong endpoint url used in get_device_status implementation Jan 18, 2023
tyge68 added a commit to tyge68/tuya-iot-python-sdk that referenced this issue Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant