toBridgeObject method
Implementation
@override
Map toBridgeObject({String? action}) {
if ('create' == action) {
return {
'name': name,
'recycle': recycle ?? false,
'lights': lightIds!.toList()
};
} else if ('attributes' == action) {
final body = {};
if (name != null) {
body['name'] = name;
}
if (lightIds != null) {
body['lights'] = lightIds!.toList();
}
return body;
}
return {};
}