You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Tuyapi's devices sharing a gateway emits dp-refresh events of all other devices of the gateway, like if the event come from the tuyapi's device itself.
To Reproduce
[Ask if you need more details, I didn't make a separate repo]
Connect to 2+ devices through a gateway with tuyapi (preferably same device type).
Fire a dp-refresh on one of them, like clicking a button or anything
The cid is the uuid we got on the Query Device Details API page from Tuya. Should use it to only emits from the right device instead of the whole gateway.
Screenshots
Desktop (please complete the following information):
OS: Linux Fedora
OS Version: Workstation 38
Node Version: v18.18.2
Additional context
I'm currently making a small abstraction layer for my smart house, making an object for each kind of devices. According to my research, device's events from the same gateway seem to not being filtered, according to the source code ( https://github.com/codetheweb/tuyapi/blob/master/index.js#L827 ). I don't think it's intended.
The text was updated successfully, but these errors were encountered:
As an abstraction layer see TuyaDAEMON. It uses a different approach: a big json object handles all devices, DP properties, and quirks. Adding a new device only requires an update of this object ('global.alldevices', a global singleton with set and get methods).
Evens are filtered by ID AND CID, so no problems.
I do mot know exactly what you mean? For this API this is one device (that there are multiple behind is nothing that API knows. so please check yourself with the cid for which device this event is fired ... Or do I miss something?
Hello,
Describe the bug
Tuyapi's devices sharing a gateway emits
dp-refresh
events of all other devices of the gateway, like if the event come from the tuyapi's device itself.To Reproduce
[Ask if you need more details, I didn't make a separate repo]
tuyapi
(preferably same device type).dp-refresh
on one of them, like clicking a button or anythingdp-refresh
is emitted from all devices bytuyapi
Solution
dp-refresh
provide anything like.
The
cid
is theuuid
we got on the Query Device Details API page from Tuya. Should use it to only emits from the right device instead of the whole gateway.Screenshots
Desktop (please complete the following information):
Additional context
I'm currently making a small abstraction layer for my smart house, making an object for each kind of devices. According to my research, device's events from the same gateway seem to not being filtered, according to the source code ( https://github.com/codetheweb/tuyapi/blob/master/index.js#L827 ). I don't think it's intended.
The text was updated successfully, but these errors were encountered: