mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
fix to send fit data to integrate with API (was true and false)now cur module send close and open with control key
This commit is contained in:
@ -35,8 +35,8 @@ class DeviceStatus {
|
||||
}
|
||||
|
||||
class Status {
|
||||
final String code;
|
||||
final dynamic value;
|
||||
String code;
|
||||
dynamic value;
|
||||
|
||||
Status({
|
||||
required this.code,
|
||||
|
@ -286,11 +286,20 @@ class ScheduleBloc extends Bloc<ScheduleEvent, ScheduleState> {
|
||||
try {
|
||||
if (state is ScheduleLoaded) {
|
||||
final dateTime = DateTime.parse(event.time);
|
||||
Status status = Status(code: '', value: '');
|
||||
if (event.category == 'CUR_2') {
|
||||
status.code = 'control';
|
||||
status.value = event.functionOn == true ? 'open' : 'close';
|
||||
} else {
|
||||
status.code = event.category;
|
||||
status.value = event.functionOn;
|
||||
}
|
||||
final updatedSchedule = ScheduleEntry(
|
||||
scheduleId: event.scheduleId,
|
||||
category: event.category,
|
||||
time: getTimeStampWithoutSeconds(dateTime).toString(),
|
||||
function: Status(code: event.category, value: event.functionOn),
|
||||
function: status,
|
||||
// Status(code: event.category, value: event.functionOn),
|
||||
days: event.selectedDays,
|
||||
);
|
||||
final success = await DevicesManagementApi().editScheduleRecord(
|
||||
|
Reference in New Issue
Block a user