Former-commit-id: cdc594971a323cafde2c8ec0c06d79c455997940
TangShanKaiPing
wanggang 6 years ago
parent d524cde4e3
commit cc8ee07c5c

@ -16,7 +16,7 @@ namespace Application.Domain.Entities
List.Add(new DeviceId { RawDeviceId = 0x0163, Name = "红外转发器", CategoryName = "电器", CategoryNumber = "20", Icon = "control", RawCategory = "wtf", EName = "IR Control" });
List.Add(new DeviceId { RawDeviceId = 0x0202, Name = "窗帘", CategoryName = "电器", CategoryNumber = "20", Icon = "curtain", RawCategory = "Closures", EName = "Window Covering Device" });
List.Add(new DeviceId { RawDeviceId = 0x0220, Name = "调色灯", CategoryName = "照明", CategoryNumber = "30", Icon = "curtain", RawCategory = "Closures", EName = "Color Temperature Light" });
List.Add(new DeviceId { RawDeviceId = 0x0309, Name = "粉尘检测器", CategoryName = "监测", CategoryNumber = "40", Icon = "dust", RawCategory = "HVAC", EName = "PM2.5 Sensor" });
List.Add(new DeviceId { RawDeviceId = 0x0309, Name = "粉尘检测器", CategoryName = "监测", CategoryNumber = "40", Icon = "pm25", RawCategory = "HVAC", EName = "PM2.5 Sensor" });
List.Add(new DeviceId { RawDeviceId = 0x0402, Name = "报警器", CategoryName = "安防", CategoryNumber = "10", Icon = "alarm", RawCategory = "Intruder Alarm Systems", EName = "IAS Zone" });
}

@ -308,6 +308,10 @@ namespace FBeeService
{
this.X70(sn, data);
}
else if (responseType == ResponseType.x72)
{
this.X70(sn, data);
}
else
{
Console.WriteLine($"{responseType} hasn't handle");
@ -1138,18 +1142,19 @@ namespace FBeeService
}
else if (clusterId == ClusterId.light)
{
device.AddorUpdateData(Keys.Light, BitConverter.ToInt16(props[0x0000]), DeviceDataType.Int, "光照");
device.AddorUpdateData(Keys.Light, BitConverter.ToInt16(props[0x0000]), DeviceDataType.Int, "光照度", "lux");
}
else if (clusterId == ClusterId.alarm)
{
device.AddorUpdateData(Keys.Warning, BitConverter.ToInt16(props[0x0080]), DeviceDataType.Int, "警报");
var state = BitConverter.ToInt16(props[0x0080]);
device.AddorUpdateData(Keys.Warning, state == 1 ? "报警" : "正常", DeviceDataType.String, "状态");
device.AddorUpdateData(Keys.UnderVoltage, new BitArray(props[0x0080])[3], DeviceDataType.Int, "低电量");
}
else if (clusterId == ClusterId.pm25)
{
device.AddorUpdateData(Keys.PM25, BitConverter.ToInt16(props[0x0000]), DeviceDataType.Int, "PM2.5");
device.AddorUpdateData(Keys.PM100, BitConverter.ToInt16(props[0x0002]), DeviceDataType.Int, "PM10");
device.AddorUpdateData(Keys.PM10, BitConverter.ToInt16(props[0x0001]), DeviceDataType.Int, "PM1.0");
device.AddorUpdateData(Keys.PM25, BitConverter.ToInt16(props[0x0000]), DeviceDataType.Int, "PM2.5", "μg/m³");
device.AddorUpdateData(Keys.PM100, BitConverter.ToInt16(props[0x0002]), DeviceDataType.Int, "PM10", "μg/m³");
device.AddorUpdateData(Keys.PM10, BitConverter.ToInt16(props[0x0001]), DeviceDataType.Int, "PM1.0", "μg/m³");
}
else if (clusterId == ClusterId.temperature)
{
@ -1205,7 +1210,6 @@ namespace FBeeService
}
}
//0x72
//0xb1
//0xb2
//0xc2
@ -1265,22 +1269,22 @@ namespace FBeeService
public void SendDevice(Device device)
{
//Console.WriteLine("send device to server");
//using (var scope = _applicationServices.CreateScope())
//{
// var clientService = scope.ServiceProvider.GetService<ClientService>();
// clientService.SendDevice(device);
//}
Console.WriteLine("send device to server");
using (var scope = _applicationServices.CreateScope())
{
var clientService = scope.ServiceProvider.GetService<ClientService>();
clientService.SendDevice(device);
}
}
public void SendDeviceInfo(DeviceInfo deviceInfo)
{
//Console.WriteLine("send device to server");
//using (var scope = _applicationServices.CreateScope())
//{
// var clientService = scope.ServiceProvider.GetService<ClientService>();
// clientService.SendDeviceInfo(deviceInfo);
//};
Console.WriteLine("send device to server");
using (var scope = _applicationServices.CreateScope())
{
var clientService = scope.ServiceProvider.GetService<ClientService>();
clientService.SendDeviceInfo(deviceInfo);
};
}
}
}

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<!--<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:">-->
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
@ -24,15 +24,12 @@
</div>
<template id="page-login">
<f7-page>
<div class="navbar">
<div class="navbar-inner">
<div class="left"></div>
<div class="title">登录</div>
<div class="right">
<a class="link external" href="javascript:;" onclick="window.location.href ='uniwebview://facelogin'"><i class="icon f7-icons">add</i></a>
</div>
</div>
</div>
<f7-navbar>
<f7-nav-title>登录</f7-nav-title>
<f7-nav-right>
<f7-link external panel-open="right" icon-f7="add" href="qr.html"></f7-link>
</f7-nav-right>
</f7-navbar>
<form v-bind:action="Server+'/Account/AppLogin'" v-on:submit.prevent="OnSubmit" class="login">
<div class="list no-hairlines-md">
<ul>
@ -159,7 +156,7 @@
<f7-list>
<f7-list-item title="用户名" :after="vm.UserName"></f7-list-item>
<f7-list-item title="昵称" :after="vm.NickName"></f7-list-item>
<f7-list-item link="/login/" title="注销"></f7-list-item>
<f7-list-item link="/login/" title="注销1"></f7-list-item>
</f7-list>
</f7-tab>
</f7-tabs>
@ -175,27 +172,24 @@
<div class="block block-strong">
<div class="row">
<div class="col-100 tablet-50 desktop-25" v-for="device in getDevices('光强检测器','粉尘检测器')">
<div class="list media-list">
<div class="list links-list">
<ul>
<li>
<a class="item-link item-content"
<a class="item-content"
:href="'/device/'+device.Number+'/name/'+device.Name">
<div class="item-media"> <img :src="'images/'+device.Icon+'.png'" /></div>
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">{{device.DisplayName||device.Name}}</div>
<div class="item-after"></div>
</div>
<div class="item-text">
<div class="item-title">{{device.DisplayName||device.Name}}</div>
<div class="item-after">
<template v-if="device.Name==='光强检测器'">
<span class="badge color-green" v-if="{{getData(device,'光照')}}">{{getData(device,'光照')}}</span>
<span v-if="getData(device,'光照度')" class="badge color-green">{{getData(device,'光照度')}}</span>
</template>
<template class="row" v-else-if="device.Name==='粉尘检测器'">
<span class="badge color-green" v-if="getData(device,'温度')">{{getData(device,'温度')}}</span>
<span class="badge color-green" v-if="getData(device,'湿度')">{{getData(device,'湿度')}}</span>
<span class="badge color-green" v-if="getData(device,'PM1.0')">{{getData(device,'PM1.0')}}</span>
<span class="badge color-green" v-if="getData(device,'PM2.5')">{{getData(device,'PM2.5')}}</span>
<span class="badge color-green" v-if="getData(device,'PM10')">{{getData(device,'PM10')}}</span>
<span v-if="getData(device,'温度')" class="badge color-green">{{getData(device,'温度')}}</span>
<span v-if="getData(device,'湿度')" class="badge color-green">{{getData(device,'湿度')}}</span>
<span v-if="getData(device,'PM1.0')" class="badge color-green">{{getData(device,'PM1.0')}}</span>
<span v-if="getData(device,'PM2.5')" class="badge color-green">{{getData(device,'PM2.5')}}</span>
<span v-if="getData(device,'PM10')" class="badge color-green">{{getData(device,'PM10')}}</span>
</template>
</div>
</div>
@ -207,6 +201,31 @@
</div>
</div>
</template>
<template v-if="getDevices('烟雾传感器','红外感应器').length">
<div class="block-title">安防</div>
<div class="block block-strong">
<div class="row">
<div class="col-100 tablet-50 desktop-25" v-for="device in getDevices('烟雾传感器','红外感应器')">
<div class="list links-list">
<ul>
<li>
<a class="item-content"
:href="'/device/'+device.Number+'/name/'+device.Name">
<div class="item-media"> <img :src="'images/'+device.Icon+'.png'" /></div>
<div class="item-inner">
<div class="item-title">{{device.DisplayName||device.Name}}</div>
<div class="item-after">
<span v-if="getData(device,'状态')" class="badge color-green">{{getData(device,'状态')}}</span>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
</f7-page>
</template>
<template id="page-device">

Loading…
Cancel
Save