mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-23 08:37:57 +00:00
fix bugs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:syncrow_web/utils/constants/app_enum.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/enum/device_types.dart';
|
||||
import 'package:syncrow_web/utils/constants/app_enum.dart';
|
||||
|
||||
class DeviceModel {
|
||||
dynamic productUuid;
|
||||
@@ -51,7 +51,6 @@ class DeviceModel {
|
||||
factory DeviceModel.fromJson(Map<String, dynamic> json) {
|
||||
String tempIcon = '';
|
||||
DeviceType type = devicesTypesMap[json['productType']] ?? DeviceType.Other;
|
||||
|
||||
if (type == DeviceType.LightBulb) {
|
||||
tempIcon = Assets.lightBulb;
|
||||
} else if (type == DeviceType.CeilingSensor || type == DeviceType.WallSensor) {
|
||||
@@ -66,9 +65,16 @@ class DeviceModel {
|
||||
tempIcon = Assets.gangSwitch;
|
||||
} else if (type == DeviceType.Gateway) {
|
||||
tempIcon = Assets.gateway;
|
||||
} else if (type == DeviceType.OneGang) {
|
||||
tempIcon = Assets.oneGang;
|
||||
} else if (type == DeviceType.TwoGang) {
|
||||
tempIcon = Assets.twoGang;
|
||||
} else if (type == DeviceType.WH) {
|
||||
tempIcon = Assets.waterHeater;
|
||||
} else {
|
||||
tempIcon = Assets.logo;
|
||||
tempIcon = Assets.blackLogo;
|
||||
}
|
||||
|
||||
return DeviceModel(
|
||||
productUuid: json['productUuid'],
|
||||
productType: json['productType'],
|
||||
|
||||
Reference in New Issue
Block a user