mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +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 {
|
class Status {
|
||||||
final String code;
|
String code;
|
||||||
final dynamic value;
|
dynamic value;
|
||||||
|
|
||||||
Status({
|
Status({
|
||||||
required this.code,
|
required this.code,
|
||||||
|
@ -286,11 +286,20 @@ class ScheduleBloc extends Bloc<ScheduleEvent, ScheduleState> {
|
|||||||
try {
|
try {
|
||||||
if (state is ScheduleLoaded) {
|
if (state is ScheduleLoaded) {
|
||||||
final dateTime = DateTime.parse(event.time);
|
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(
|
final updatedSchedule = ScheduleEntry(
|
||||||
scheduleId: event.scheduleId,
|
scheduleId: event.scheduleId,
|
||||||
category: event.category,
|
category: event.category,
|
||||||
time: getTimeStampWithoutSeconds(dateTime).toString(),
|
time: getTimeStampWithoutSeconds(dateTime).toString(),
|
||||||
function: Status(code: event.category, value: event.functionOn),
|
function: status,
|
||||||
|
// Status(code: event.category, value: event.functionOn),
|
||||||
days: event.selectedDays,
|
days: event.selectedDays,
|
||||||
);
|
);
|
||||||
final success = await DevicesManagementApi().editScheduleRecord(
|
final success = await DevicesManagementApi().editScheduleRecord(
|
||||||
|
Reference in New Issue
Block a user