Resloves #133 Light support
This commit is contained in:
@ -518,9 +518,7 @@ class LightEntity extends Entity {
|
||||
double get minMireds => _getDoubleAttributeValue("min_mireds");
|
||||
Color get color => _getColor();
|
||||
bool get isAdditionalControls => ((attributes["supported_features"] != null) && (attributes["supported_features"] != 0));
|
||||
List<String> get effectList => attributes["effect_list"] != null
|
||||
? (attributes["effect_list"] as List).cast<String>()
|
||||
: null;
|
||||
List<String> get effectList => _getEffectList();
|
||||
|
||||
LightEntity(Map rawData) : super(rawData);
|
||||
|
||||
@ -537,6 +535,15 @@ class LightEntity extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
List<String> _getEffectList() {
|
||||
if (attributes["effect_list"] != null) {
|
||||
List<String> result = (attributes["effect_list"] as List).cast<String>();
|
||||
return result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget _buildStatePart(BuildContext context) {
|
||||
return SwitchStateWidget();
|
||||
|
Reference in New Issue
Block a user