twist-innovation-api 0.0.7__py3-none-any.whl → 0.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- twist/TwistAPI.py +10 -2
- {twist_innovation_api-0.0.7.dist-info → twist_innovation_api-0.0.8.dist-info}/METADATA +1 -1
- {twist_innovation_api-0.0.7.dist-info → twist_innovation_api-0.0.8.dist-info}/RECORD +6 -6
- {twist_innovation_api-0.0.7.dist-info → twist_innovation_api-0.0.8.dist-info}/WHEEL +0 -0
- {twist_innovation_api-0.0.7.dist-info → twist_innovation_api-0.0.8.dist-info}/licenses/LICENSE +0 -0
- {twist_innovation_api-0.0.7.dist-info → twist_innovation_api-0.0.8.dist-info}/top_level.txt +0 -0
twist/TwistAPI.py
CHANGED
|
@@ -46,12 +46,20 @@ class TwistAPI:
|
|
|
46
46
|
self._backend_adapter = BackendAdapter(
|
|
47
47
|
backend_url, api_key, installation_uuid)
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
def set_mqtt_publish(self, publisher):
|
|
50
|
+
"""Set MQTT publish function so entities can send messages during registration."""
|
|
50
51
|
self._ext_publish = publisher
|
|
51
|
-
self._subscribe = subscriber
|
|
52
52
|
|
|
53
|
+
async def set_mqtt_subscribe(self, subscriber):
|
|
54
|
+
"""Set MQTT subscribe function and start receiving messages."""
|
|
55
|
+
self._subscribe = subscriber
|
|
53
56
|
await self._subscribe(f"v2/{self.installation_id}/rx/#", self._on_message_received)
|
|
54
57
|
|
|
58
|
+
async def add_mqtt(self, publisher, subscriber):
|
|
59
|
+
"""Legacy method for backward compatibility - sets both publish and subscribe."""
|
|
60
|
+
self.set_mqtt_publish(publisher)
|
|
61
|
+
await self.set_mqtt_subscribe(subscriber)
|
|
62
|
+
|
|
55
63
|
async def get_models(self):
|
|
56
64
|
"""
|
|
57
65
|
Get models from backend
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
twist/BackendAdapter.py,sha256=v-kjbuuHyktIjWX6MG_I3sH3ZQBawJhSiwBzzatZ3C0,9758
|
|
2
|
-
twist/TwistAPI.py,sha256=
|
|
2
|
+
twist/TwistAPI.py,sha256=5KnvL6_FEMo-ujO-9y1K-eAsALgKyEZ880hnHMl86sM,6546
|
|
3
3
|
twist/TwistBinarySensor.py,sha256=k9gsF1dTR3E_kiB60R1SUuUc9oUGGRGs592fQqy2VPM,1747
|
|
4
4
|
twist/TwistButton.py,sha256=p5svcsU6maGwyWa06NnlKCGUXHoFzuwFPEQI0UqoGB4,2172
|
|
5
5
|
twist/TwistDevice.py,sha256=-ttj9LrZhR3BwLK4ADSe2TrTtY5Z3GMkz3BruUP_jCU,1159
|
|
@@ -12,8 +12,8 @@ twist/TwistSensor.py,sha256=6eYrwtZFFFOHmoHS68JHmsyi6FVVzoQy19KooGU0vMI,1192
|
|
|
12
12
|
twist/TwistShutter.py,sha256=gXMbgV_Y-3GLzxE0K6XRP6qqDHEw0uySjZc82IOMsYY,3328
|
|
13
13
|
twist/TwistTypes.py,sha256=k1CdLqjhJi8MyrFZsHkDsEoL9gEXF-HQv6I-r3G7ngA,726
|
|
14
14
|
twist/__init__.py,sha256=gf8GHc9utiG0vD8GP3IfzLFHAG-ev1TXBIm0XUHxy38,201
|
|
15
|
-
twist_innovation_api-0.0.
|
|
16
|
-
twist_innovation_api-0.0.
|
|
17
|
-
twist_innovation_api-0.0.
|
|
18
|
-
twist_innovation_api-0.0.
|
|
19
|
-
twist_innovation_api-0.0.
|
|
15
|
+
twist_innovation_api-0.0.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
16
|
+
twist_innovation_api-0.0.8.dist-info/METADATA,sha256=wYNgPra3j3TNsrSt5vXcG505T19YJTIFpUpTcXH8KRs,4335
|
|
17
|
+
twist_innovation_api-0.0.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
18
|
+
twist_innovation_api-0.0.8.dist-info/top_level.txt,sha256=mkoeBkRPFodjnd-3UDf9YndjTQ6Sriz-EKSI4nQ7brs,6
|
|
19
|
+
twist_innovation_api-0.0.8.dist-info/RECORD,,
|
|
File without changes
|
{twist_innovation_api-0.0.7.dist-info → twist_innovation_api-0.0.8.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|