@@ -69,10 +69,10 @@ def _mqtt_disconnect(self, client, userdata, rc):
69
69
def _mqtt_message (self , client , userdata , msg ):
70
70
logger .debug ('Client on_message called.' )
71
71
# Parse out the feed id and call on_message callback.
72
- # Assumes topic looks like "api/feeds/{feed_id}/streams /receive.json"
72
+ # Assumes topic looks like "api/feeds/{feed_id}/data /receive.json"
73
73
if self .on_message is not None and msg .topic .startswith ('api/feeds/' ) \
74
- and len (msg .topic ) >= 31 :
75
- feed_id = msg .topic [10 :- 21 ]
74
+ and len (msg .topic ) >= 28 :
75
+ feed_id = msg .topic [10 :- 18 ]
76
76
self .on_message (self , feed_id , msg .payload )
77
77
78
78
def connect (self , ** kwargs ):
@@ -132,7 +132,7 @@ def subscribe(self, feed_id):
132
132
"""Subscribe to changes on the specified feed. When the feed is updated
133
133
the on_message function will be called with the feed_id and new value.
134
134
"""
135
- self ._client .subscribe ('api/feeds/{0}/streams /receive.json' .format (feed_id ))
135
+ self ._client .subscribe ('api/feeds/{0}/data /receive.json' .format (feed_id ))
136
136
137
137
def publish (self , feed_id , value ):
138
138
"""Publish a value to a specified feed.
@@ -141,5 +141,5 @@ def publish(self, feed_id, value):
141
141
- feed_id: The id of the feed to update.
142
142
- value: The new value to publish to the feed.
143
143
"""
144
- self ._client .publish ('api/feeds/{0}/streams /send.json' .format (feed_id ),
144
+ self ._client .publish ('api/feeds/{0}/data /send.json' .format (feed_id ),
145
145
payload = value )
0 commit comments