mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 10:06:19 +00:00
@ -58,8 +58,7 @@ class ScheduleEntry {
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory ScheduleEntry.fromJson(String source) =>
|
||||
ScheduleEntry.fromMap(json.decode(source));
|
||||
factory ScheduleEntry.fromJson(String source) => ScheduleEntry.fromMap(json.decode(source));
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
@ -74,9 +73,6 @@ class ScheduleEntry {
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return category.hashCode ^
|
||||
time.hashCode ^
|
||||
function.hashCode ^
|
||||
days.hashCode;
|
||||
return category.hashCode ^ time.hashCode ^ function.hashCode ^ days.hashCode;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class ScheduleModel {
|
||||
final String scheduleId;
|
||||
@ -94,8 +93,8 @@ class ScheduleModel {
|
||||
|
||||
static List<String> convertSelectedDaysToStrings(List<bool> selectedDays) {
|
||||
const allDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
||||
final result = <String>[];
|
||||
for (var i = 0; i < selectedDays.length; i++) {
|
||||
List<String> result = [];
|
||||
for (int i = 0; i < selectedDays.length; i++) {
|
||||
if (selectedDays[i]) {
|
||||
result.add(allDays[i]);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class WaterHeaterStatusModel extends Equatable {
|
||||
final String cycleTiming;
|
||||
final List<ScheduleModel> schedules;
|
||||
|
||||
const WaterHeaterStatusModel({
|
||||
const WaterHeaterStatusModel({
|
||||
required this.uuid,
|
||||
required this.heaterSwitch,
|
||||
required this.countdownHours,
|
||||
@ -30,13 +30,13 @@ class WaterHeaterStatusModel extends Equatable {
|
||||
});
|
||||
|
||||
factory WaterHeaterStatusModel.fromJson(String id, List<Status> jsonList) {
|
||||
late var heaterSwitch = false;
|
||||
late var countdownInSeconds = 0;
|
||||
late var relayStatus = '';
|
||||
late var cycleTiming = '';
|
||||
late var scheduleMode = ScheduleModes.countdown;
|
||||
late bool heaterSwitch = false;
|
||||
late int countdownInSeconds = 0;
|
||||
late String relayStatus = '';
|
||||
late String cycleTiming = '';
|
||||
late ScheduleModes scheduleMode = ScheduleModes.countdown;
|
||||
|
||||
for (final status in jsonList) {
|
||||
for (var status in jsonList) {
|
||||
switch (status.code) {
|
||||
case 'switch_1':
|
||||
heaterSwitch = status.value ?? false;
|
||||
|
Reference in New Issue
Block a user