Browse Source

智能家居接口对接

znjj
lzp 4 months ago
parent
commit
12079ffb64
  1. 2
      .env.production
  2. 17
      src/views/index.vue

2
.env.production

@ -11,6 +11,6 @@ VUE_APP_IMG_URL = '/multimodal/'
VUE_APP_API_QZURL = '/multimodal/'
# 访问路径
VUE_APP_PUBLIC_PATH = '/multimodal_yf/waterTemperature/'
VUE_APP_PUBLIC_PATH = '/multimodal_yf/safetySys/'

17
src/views/index.vue

@ -17,7 +17,7 @@
</div>
<div>
<span>预警</span>
<el-switch active-value="1" inactive-value="0" v-model="deviceInfo.warning" active-color="#13ce66"
<el-switch disabled active-value="1" inactive-value="0" v-model="deviceInfo.warning" active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</div>
@ -160,7 +160,20 @@ export default {
co: this.form.co, // CO
}
sendAttribute({
"attributeParams": JSON.stringify(attributeParams), // JSON
"attributeAndValues": [
{
"attributeIdentifier": "tempThreshold",
"attributeValue": this.form.temperature
},
{
"attributeIdentifier": "humiThreshold",
"attributeValue": this.form.humidity
},
{
"attributeIdentifier": "coThreshold",
"attributeValue": this.form.co
}
], // JSON
"deviceId": this.deviceId // id
}).then(response => {
this.getAttributes(this.deviceId); // id

Loading…
Cancel
Save