Conversation
Adds a pure-asyncio Tuya P2P client (api/p2p) that opens the encrypted map channel on the LAN with the device local key, and returns the room list for mqtt=False devices (e.g. S1 Pro) that expose it nowhere else. The coordinator fetches the RTC config (device_password + ICE servers) from Tuya Cloud, runs the P2P session in the background on local connect, and populates data.rooms; the room select entity is enabled for local devices. Verified end to end against an S1 Pro (T2080A, fw 7.0.170). See docs/P2P_MAP_CHANNEL.md.
Extends the P2P session to return the full conversation-5 snapshot, builds a MapData from it (room outline synthesised into the renderer's base when the real-time map is absent), and feeds the existing map camera. The camera now works on local Tuya devices, not just MQTT. Rooms unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the room list (with names) and the live floor map for
mqtt=Falsedevices like the S1 Pro. These devices expose neither on any DPS nor on thebiz/MQTT stream, so today the room dropdown is empty and the map camera stays blank.How
api/p2p/: opens the encrypted Tuya P2P map channel on the LAN with the device local key, runs the ICE/KCP handshake, and decodes the map stream. Pure asyncio, no new dependency. The channel and how to open it are documented indocs/P2P_MAP_CHANNEL.md.device_password+ ICE servers) from Tuya Cloud, runs one P2P session in the background on local connect, then:data.rooms(room select enabled for local devices);MapDataand feeds the existing map camera, socamera.<device>_mapnow works on local Tuya devices too.Tested
tests/test_p2p.py: framing, KCP tag, room decode (keeps room id 0).Notes