|
@@ -80,7 +80,7 @@ export function removeListener (type, cb) {
|
|
|
|
|
|
|
|
function getTypeBySend (topic) {
|
|
function getTypeBySend (topic) {
|
|
|
switch (topic) {
|
|
switch (topic) {
|
|
|
- case 'status/ask':
|
|
|
|
|
|
|
+ case '/status/ask':
|
|
|
return 'status'
|
|
return 'status'
|
|
|
default:
|
|
default:
|
|
|
return null
|
|
return null
|
|
@@ -88,7 +88,7 @@ function getTypeBySend (topic) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export function send (topic, message) {
|
|
export function send (topic, message) {
|
|
|
- return publish(`${productId}/${deviceId}/${topic}`, JSON.stringify(message || { timestamp: Date.now() })).then(() => {
|
|
|
|
|
|
|
+ return publish(`${productId}/${deviceId}${topic}`, JSON.stringify(message || { timestamp: Date.now() })).then(() => {
|
|
|
const inst = types.get(getTypeBySend(topic))
|
|
const inst = types.get(getTypeBySend(topic))
|
|
|
if (inst && inst.type === Type.LOAD) {
|
|
if (inst && inst.type === Type.LOAD) {
|
|
|
inst.loading = true
|
|
inst.loading = true
|