Skip to content

Wrong endpoint url used in get_device_status implementation #71

@tyge68

Description

@tyge68

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions