diff --git a/assets/icons/Illuminance_icon.svg b/assets/icons/Illuminance_icon.svg
new file mode 100644
index 00000000..379c45f9
--- /dev/null
+++ b/assets/icons/Illuminance_icon.svg
@@ -0,0 +1,18 @@
+
diff --git a/assets/icons/Indicator_icon.svg b/assets/icons/Indicator_icon.svg
new file mode 100644
index 00000000..a542e9fa
--- /dev/null
+++ b/assets/icons/Indicator_icon.svg
@@ -0,0 +1,12 @@
+
diff --git a/assets/icons/current_distance_icon.svg b/assets/icons/current_distance_icon.svg
new file mode 100644
index 00000000..d4c87601
--- /dev/null
+++ b/assets/icons/current_distance_icon.svg
@@ -0,0 +1,17 @@
+
diff --git a/assets/icons/far_detection_icon.svg b/assets/icons/far_detection_icon.svg
new file mode 100644
index 00000000..b41b000a
--- /dev/null
+++ b/assets/icons/far_detection_icon.svg
@@ -0,0 +1,16 @@
+
diff --git a/assets/icons/motion_detection_sensitivity_icon.svg b/assets/icons/motion_detection_sensitivity_icon.svg
new file mode 100644
index 00000000..cd527f13
--- /dev/null
+++ b/assets/icons/motion_detection_sensitivity_icon.svg
@@ -0,0 +1,21 @@
+
diff --git a/assets/icons/motion_detection_sensitivity_value_icon.svg b/assets/icons/motion_detection_sensitivity_value_icon.svg
new file mode 100644
index 00000000..21bebd7a
--- /dev/null
+++ b/assets/icons/motion_detection_sensitivity_value_icon.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/icons/motionless_detection_sensitivity_icon.svg b/assets/icons/motionless_detection_sensitivity_icon.svg
new file mode 100644
index 00000000..a1dc2926
--- /dev/null
+++ b/assets/icons/motionless_detection_sensitivity_icon.svg
@@ -0,0 +1,6 @@
+
diff --git a/assets/icons/presence_state.svg b/assets/icons/presence_state.svg
new file mode 100644
index 00000000..0c5ad042
--- /dev/null
+++ b/assets/icons/presence_state.svg
@@ -0,0 +1,18 @@
+
diff --git a/assets/icons/presence_time_icon.svg b/assets/icons/presence_time_icon.svg
new file mode 100644
index 00000000..d1c22e03
--- /dev/null
+++ b/assets/icons/presence_time_icon.svg
@@ -0,0 +1,29 @@
+
diff --git a/lib/pages/device_managment/all_devices/models/devices_model.dart b/lib/pages/device_managment/all_devices/models/devices_model.dart
index e71d5af8..0a3b346c 100644
--- a/lib/pages/device_managment/all_devices/models/devices_model.dart
+++ b/lib/pages/device_managment/all_devices/models/devices_model.dart
@@ -8,6 +8,7 @@ import 'package:syncrow_web/pages/routines/models/device_functions.dart';
import 'package:syncrow_web/pages/routines/models/gang_switches/one_gang_switch/one_gang_switch.dart';
import 'package:syncrow_web/pages/routines/models/gang_switches/three_gang_switch/three_gang_switch.dart';
import 'package:syncrow_web/pages/routines/models/gang_switches/two_gang_switch/two_gang_switch.dart';
+import 'package:syncrow_web/pages/routines/models/wps/wps_functions.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/enum/device_types.dart';
@@ -148,7 +149,9 @@ class AllDevicesModel {
productName = json['productName']?.toString();
if (json['spaces'] != null && json['spaces'] is List) {
- spaces = (json['spaces'] as List).map((space) => DeviceSpaceModel.fromJson(space)).toList();
+ spaces = (json['spaces'] as List)
+ .map((space) => DeviceSpaceModel.fromJson(space))
+ .toList();
}
}
@@ -196,7 +199,8 @@ SOS
String tempIcon = '';
if (type == DeviceType.LightBulb) {
tempIcon = Assets.lightBulb;
- } else if (type == DeviceType.CeilingSensor || type == DeviceType.WallSensor) {
+ } else if (type == DeviceType.CeilingSensor ||
+ type == DeviceType.WallSensor) {
tempIcon = Assets.sensors;
} else if (type == DeviceType.AC) {
tempIcon = Assets.ac;
@@ -226,6 +230,8 @@ SOS
// tempIcon = Assets.gang3touch;
} else if (type == DeviceType.WaterLeak) {
tempIcon = Assets.waterLeakNormal;
+ } else if (type == DeviceType.WaterLeak) {
+ tempIcon = Assets.waterLeakNormal;
} else {
tempIcon = Assets.logoHorizontal;
}
@@ -252,27 +258,62 @@ SOS
case '1G':
return [
OneGangSwitchFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
- OneGangCountdownFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
+ OneGangCountdownFunction(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
];
case '2G':
return [
TwoGangSwitch1Function(deviceId: uuid ?? '', deviceName: name ?? ''),
TwoGangSwitch2Function(deviceId: uuid ?? '', deviceName: name ?? ''),
- TwoGangCountdown1Function(deviceId: uuid ?? '', deviceName: name ?? ''),
- TwoGangCountdown2Function(deviceId: uuid ?? '', deviceName: name ?? ''),
+ TwoGangCountdown1Function(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
+ TwoGangCountdown2Function(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
];
case '3G':
return [
- ThreeGangSwitch1Function(deviceId: uuid ?? '', deviceName: name ?? ''),
- ThreeGangSwitch2Function(deviceId: uuid ?? '', deviceName: name ?? ''),
- ThreeGangSwitch3Function(deviceId: uuid ?? '', deviceName: name ?? ''),
- ThreeGangCountdown1Function(deviceId: uuid ?? '', deviceName: name ?? ''),
- ThreeGangCountdown2Function(deviceId: uuid ?? '', deviceName: name ?? ''),
- ThreeGangCountdown3Function(deviceId: uuid ?? '', deviceName: name ?? ''),
+ ThreeGangSwitch1Function(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
+ ThreeGangSwitch2Function(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
+ ThreeGangSwitch3Function(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
+ ThreeGangCountdown1Function(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
+ ThreeGangCountdown2Function(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
+ ThreeGangCountdown3Function(
+ deviceId: uuid ?? '', deviceName: name ?? ''),
];
+ case 'WPS':
+ return [
+ //IF Functions
+ PresenceStateFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'THEN'),
+ CurrentDistanceFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'THEN'),
+ IlluminanceValueFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'THEN'),
+ PresenceTimeFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'THEN'),
+ //THEN Functions
+ FarDetectionFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'IF'),
+ MotionSensitivityFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'IF'),
+ MotionLessSensitivityFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'IF'),
+ IndicatorFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'BOTH'),
+ NoOneTimeFunction(
+ deviceId: uuid ?? '', deviceName: name ?? '', type: 'IF'),
+
+ // FarDetectionSliderFunction(
+ // deviceId: uuid ?? '', deviceName: name ?? '', type: 'THEN')
+ ];
default:
return [];
}
diff --git a/lib/pages/device_managment/water_heater/widgets/count_down_inching_view.dart b/lib/pages/device_managment/water_heater/widgets/count_down_inching_view.dart
index 53892c20..9c28d4d6 100644
--- a/lib/pages/device_managment/water_heater/widgets/count_down_inching_view.dart
+++ b/lib/pages/device_managment/water_heater/widgets/count_down_inching_view.dart
@@ -95,6 +95,77 @@ class CountdownInchingView extends StatelessWidget {
);
}
+ Row _hourMinutesSecondWheel(
+ BuildContext context, WaterHeaterDeviceStatusLoaded state) {
+ final isCountDown =
+ state.scheduleMode?.name == ScheduleModes.countdown.name;
+ late bool isActive;
+ if (isCountDown &&
+ state.countdownRemaining != null &&
+ state.isCountdownActive == true) {
+ isActive = true;
+ } else if (!isCountDown &&
+ state.countdownRemaining != null &&
+ state.isInchingActive == true) {
+ isActive = true;
+ } else {
+ isActive = false;
+ }
+
+ return Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ _buildPickerColumn(
+ context,
+ 'h',
+ isCountDown
+ ? (state.countdownHours ?? 0)
+ : (state.inchingHours ?? 0),
+ 24, (value) {
+ context.read().add(UpdateScheduleEvent(
+ scheduleMode: state.scheduleMode ?? ScheduleModes.countdown,
+ hours: value,
+ minutes: isCountDown
+ ? (state.countdownMinutes ?? 0)
+ : (state.inchingMinutes ?? 0),
+ ));
+ }, isActive: isActive),
+ const SizedBox(width: 10),
+ _buildPickerColumn(
+ context,
+ 'm',
+ isCountDown
+ ? (state.countdownMinutes ?? 0)
+ : (state.inchingMinutes ?? 0),
+ 60, (value) {
+ context.read().add(UpdateScheduleEvent(
+ scheduleMode: state.scheduleMode ?? ScheduleModes.countdown,
+ hours: isCountDown
+ ? (state.countdownHours ?? 0)
+ : (state.inchingHours ?? 0),
+ minutes: value,
+ ));
+ }, isActive: isActive),
+ const SizedBox(width: 10),
+ _buildPickerColumn(
+ context,
+ 'S',
+ isCountDown
+ ? (state.countdownMinutes ?? 0)
+ : (state.inchingMinutes ?? 0),
+ 60, (value) {
+ context.read().add(UpdateScheduleEvent(
+ scheduleMode: state.scheduleMode ?? ScheduleModes.countdown,
+ hours: isCountDown
+ ? (state.countdownHours ?? 0)
+ : (state.inchingHours ?? 0),
+ minutes: value,
+ ));
+ }, isActive: isActive),
+ ],
+ );
+ }
+
Widget _buildPickerColumn(
BuildContext context,
String label,
diff --git a/lib/pages/routines/helper/dialog_helper/device_dialog_helper.dart b/lib/pages/routines/helper/dialog_helper/device_dialog_helper.dart
index 933b35d7..48eaedb9 100644
--- a/lib/pages/routines/helper/dialog_helper/device_dialog_helper.dart
+++ b/lib/pages/routines/helper/dialog_helper/device_dialog_helper.dart
@@ -6,21 +6,24 @@ import 'package:syncrow_web/pages/routines/widgets/routine_dialogs/one_gang_swit
import 'package:syncrow_web/pages/routines/widgets/routine_dialogs/three_gang_switch_dialog.dart';
import 'package:syncrow_web/pages/routines/widgets/routine_dialogs/two_gang_switch_dialog.dart';
import 'package:syncrow_web/pages/routines/models/device_functions.dart';
+import 'package:syncrow_web/pages/routines/widgets/routine_dialogs/wall_sensor/wall_presence_sensor.dart';
class DeviceDialogHelper {
- static Future