if dev_type == "7PIN_BK_EU":#英文小瑞
url = "http://dmp-global.raisound.com/bz-api/dev/time"
else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/time"
url = "https://dmp-api.qipai.com/qp-dmp-api/dev/time"
# url = "http://dmp.raisound.com/bz-api/dev/time"
response = request.get(url,timeout=5)
if dev_type == "7PIN_BK_EU":#英文小瑞
url = "http://dmp-global.raisound.com/bz-api/dev/auth/active"
else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/auth/active"
url = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/active"
# url = "http://dmp.raisound.com/bz-api/dev/auth/active"
data =ujson.dumps(data)
if dev_type == "7PIN_BK_EU":#英文小瑞
sign_url = "http://dmp-global.raisound.com/bz-api/dev/auth/sign_in" #登入地址
else:
- sign_url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/auth/sign_in" #登入地址
sign_url = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/sign_in"
# sign_url = "http://dmp.raisound.com/bz-api/dev/auth/sign_in" #登入地址
#获取验证码
if dev_type == "7PIN_BK_EU":#英文小瑞
url = "http://dmp-global.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
url = "https://dmp-api.qipai.com/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
# url = "http://dmp.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid) #北科地址
print("{} H:{}".format(url,headers_T))
if dev_type == "7PIN_BK_EU":#英文小瑞
dev_tokenip = "http://dmp-global.raisound.com/bz-api/dev/auth/token" #设备新令牌更新地址
else:
- dev_tokenip = "https://qipai-dev.dobell.top/qp-dmp-api/dev/auth/token" #设备新令牌更新地址
dev_tokenip = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/token"
# dev_tokenip = "http://dmp.raisound.com/bz-api/dev/auth/token" #设备新令牌更新地址
# if dev_type == "7PIN" or dev_type == "7PIN_coze":#柒牌
# url = "http://ota.qipai.com/bz-cmp-api/api/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
# else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
url = "https://dmp-api.qipai.com/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
print(url)
response = request.get(url,timeout=5)
# if dev_type == "7PIN" or dev_type == "7PIN_coze":#柒牌
# url = "http://ota.qipai.com/bz-cmp-api/api/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
# else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
url = "https://dmp-api.qipai.com/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
print(url)
response = request.get(url,timeout=5)
# if dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze":#柒牌
# url = "http://ota.qipai.com/bz-cmp-api/api/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
# else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
url = "https://dmp-api.qipai.com/qp-dmp-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
print(url)
response = request.post(url,timeout=5)
if dev_type == "7PIN_BK_EU":#英文小瑞
url = "http://dmp-global.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
url = "https://dmp-api.qipai.com/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
# url = "http://dmp.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid) #北科地址
print("{} H:{}".format(url,headers_T))
else:
self.AI_TTS_str = "当前已是最新版本"
return 0
- if text.find("语音留言") != -1:
- self.voice_flag = 1
- self.AI_TTS_str = "已进入语音留言模式,长按按钮开始录音,松开按钮结束"
- self.Close_flag = 1
- self.stop_voice_timer.stop() #关闭语音留言模式定时器
- self.stop_voice_timer.start(30*1000,0,self.exit_voice_message_timer)
- print("语音留言!!!!!!!!!!")
- return 0
- if text.find("开广播") != -1 or text.find("开蓝牙广播") != -1:
-
- self.AI_TTS_str = "正在开蓝牙广播"
- EventMesh.publish("AI_send_bt_ble_switch_toble",1)
-
- print("正在开蓝牙广播")
- return 0
- if text.find("关广播") != -1 or text.find("关蓝牙广播") != -1:
-
- self.AI_TTS_str = "正在关蓝牙广播"
- EventMesh.publish("AI_send_bt_ble_switch_toble",2)
+ if dev_type == "7PIN_1_5":#二代才有蓝牙和语音留言功能
+ if text.find("语音留言") != -1:
+ self.voice_flag = 1
+ self.AI_TTS_str = "已进入语音留言模式,长按按钮开始录音,松开按钮结束"
+ self.Close_flag = 1
+ self.stop_voice_timer.stop() #关闭语音留言模式定时器
+ self.stop_voice_timer.start(30*1000,0,self.exit_voice_message_timer)
+ print("语音留言!!!!!!!!!!")
+ return 0
+ if text.find("开广播") != -1 or text.find("开蓝牙广播") != -1:
+
+ self.AI_TTS_str = "正在开蓝牙广播"
+ EventMesh.publish("AI_send_bt_ble_switch_toble",1)
- print("正在关蓝牙广播")
- return 0
- if text.find("开经典蓝牙") != -1:
-
- self.AI_TTS_str = "正在开经典蓝牙"
- EventMesh.publish("AI_send_bt_ble_switch_toble",3)
- print("正在开经典蓝牙")
- return 0
- if text.find("关闭经典蓝牙") != -1 or text.find("关经典蓝牙") != -1:
-
- self.AI_TTS_str = "正在关经典蓝牙"
- EventMesh.publish("AI_send_bt_ble_switch_toble",4)
- print("正在关经典蓝牙")
- return 0
-
- if text.find("确认解绑设备") != -1 or text.find("确认设备解绑") != -1:
- self.AI_TTS_str = "设备解绑中...."
- self.Close_flag = 1
- EventMesh.publish("send_unbind_dev_to_iot")
- print("解绑设备!!!!!!!!!!!!!!")
- return 0
- if text.find("删除耳机记录") != -1 or text.find("清楚耳机记录") != -1:
-
- self.AI_TTS_str = "正在删除"
- EventMesh.publish("clear_earphone_record")
+ print("正在开蓝牙广播")
+ return 0
+ if text.find("关广播") != -1 or text.find("关蓝牙广播") != -1:
+
+ self.AI_TTS_str = "正在关蓝牙广播"
+ EventMesh.publish("AI_send_bt_ble_switch_toble",2)
- print("正在删除")
- return 0
- if len(text)<16 and (text.find("再见") != -1 or text.find("拜拜") != -1 or text.find("关闭对话") != -1):
- #EventMesh.publish("publish_AI_btnInfo",{"func":self.Close})
- if dev_type != "7PIN" and dev_type != "7PIN_coze" and dev_type != "7PIN_1_5":#柒牌
- self.AI_TTS_str = "好嘞,再见,我们下次再聊"
+ print("正在关蓝牙广播")
+ return 0
+ if text.find("开经典蓝牙") != -1:
+
+ self.AI_TTS_str = "正在开经典蓝牙"
+ EventMesh.publish("AI_send_bt_ble_switch_toble",3)
+ print("正在开经典蓝牙")
+ return 0
+ if text.find("关闭经典蓝牙") != -1 or text.find("关经典蓝牙") != -1:
+
+ self.AI_TTS_str = "正在关经典蓝牙"
+ EventMesh.publish("AI_send_bt_ble_switch_toble",4)
+ print("正在关经典蓝牙")
+ return 0
+
+ if text.find("确认解绑设备") != -1 or text.find("确认设备解绑") != -1:
+ self.AI_TTS_str = "设备解绑中...."
self.Close_flag = 1
+ EventMesh.publish("send_unbind_dev_to_iot")
+ print("解绑设备!!!!!!!!!!!!!!")
return 0
- else:
- EventMesh.publish("publish_AI_btnInfo",{"func":self.Close})
- #EventMesh.publish("sleep_BT")#休眠蓝牙
- return 1
+ if text.find("删除耳机记录") != -1 or text.find("清楚耳机记录") != -1:
+
+ self.AI_TTS_str = "正在删除"
+ EventMesh.publish("clear_earphone_record")
+
+ print("正在删除")
+ return 0
+ # if len(text)<16 and (text.find("再见") != -1 or text.find("拜拜") != -1 or text.find("关闭对话") != -1):
+ # #EventMesh.publish("publish_AI_btnInfo",{"func":self.Close})
+ # if dev_type != "7PIN" and dev_type != "7PIN_coze" and dev_type != "7PIN_1_5":#柒牌
+ # self.AI_TTS_str = "好嘞,再见,我们下次再聊"
+ # self.Close_flag = 1
+ # return 0
+ # else:
+ # EventMesh.publish("publish_AI_btnInfo",{"func":self.Close})
+ # #EventMesh.publish("sleep_BT")#休眠蓝牙
+ # return 1
if len(text)<12 and (text.find("关机") != -1 ):
if dev_type == "7PIN" or dev_type == "7PIN_coze" or dev_type == "7PIN_1_5":#柒牌
EventMesh.publish("publish_AI_btnInfo",{"func":self.Close})