WIP #142 Alarm control panel

This commit is contained in:
Yegor Vyalov
2019-01-28 16:48:49 +02:00
parent 96b528e055
commit dc3ca38c78
5 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,44 @@
part of '../../main.dart';
class AlarmControlPanelControlsWidget extends StatefulWidget {
@override
_AlarmControlPanelControlsWidgetWidgetState createState() => _AlarmControlPanelControlsWidgetWidgetState();
}
class _AlarmControlPanelControlsWidgetWidgetState extends State<AlarmControlPanelControlsWidget> {
void _disarm(AlarmControlPanelEntity entity, String code) {
eventBus.fire(new ServiceCallEvent(
entity.domain, "alarm_disarm", entity.entityId,
{"code": "$code"}));
}
@override
Widget build(BuildContext context) {
final entityModel = EntityModel.of(context);
final AlarmControlPanelEntity entity = entityModel.entityWrapper.entity;
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
TextField(
//focusNode: _focusNode,
obscureText: true,
/*controller: new TextEditingController.fromValue(
new TextEditingValue(
text: _tmpValue,
selection:
new TextSelection.collapsed(offset: _tmpValue.length)
)
),*/
onChanged: (value) {
Logger.d('Alarm code: $value');
})
],
);
}
}