tuya / tuya-iot-python-sdk

Tuya IoT Python SDK for Tuya Open API.
MIT License
130 stars 49 forks source link

Feature request: add battery_low information #3

Closed t0ny-peng closed 3 years ago

t0ny-peng commented 3 years ago

Hi @tsutsuku. Thank for the effort of maintaining this repo.

From what it states in the doc of Tuya open API, the returned message seems to contain a field called battery_low indicating if the battery is low(obviously). But this field is missing in the device information. Is the return message just for demo purpose? If not, it shouldn't be hard to add the missing part, right?

Thx.

tsutsuku commented 3 years ago

@t0ny-peng
The battery_low is a dp code. Not all devices have this dp code. So It should not be in the normal device information. Some device like a sensor, which may has this dp code, can get it from the device's status dict.

data point (DP) : https://developer.tuya.com/en/docs/iot/terms?id=K914joq6tegj4