Refactor device status handling and update UI components

- Update device status handling from 'status' to 'isOnline' for consistency
- Remove unused imports and redundant code related to light switches
- Refactor UI components to use 'isOnline' instead of 'status' for device status
This commit is contained in:
Mohammad Salameh
2024-04-01 09:58:51 +03:00
parent 3031d19836
commit a20dfa3709
12 changed files with 152 additions and 545 deletions

View File

@ -1,21 +1,10 @@
//{
// "code": "switch_1",
// "desc": "switch 1",
// "name": "switch 1",
// "type": "Boolean",
// "values": "{}"
// }
class FunctionModel {
String? code;
String? desc;
String? name;
String? type;
String? values;
FunctionModel({
required this.code,
required this.desc,
required this.name,
required this.type,
required this.values,
});
@ -23,8 +12,6 @@ class FunctionModel {
factory FunctionModel.fromJson(Map<String, dynamic> json) {
return FunctionModel(
code: json['code'],
desc: json['desc'],
name: json['name'],
type: json['type'],
values: json['values'],
);
@ -33,8 +20,6 @@ class FunctionModel {
Map<String, dynamic> toJson() {
return {
'code': code,
'desc': desc,
'name': name,
'type': type,
'values': values,
};