This repository has been archived on 2023-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
ha_client/lib/entity_class/slider_entity.dart

44 lines
1.0 KiB
Dart
Raw Normal View History

2018-10-27 14:27:41 +03:00
part of '../main.dart';
class SliderEntity extends Entity {
2019-03-19 23:07:40 +02:00
SliderEntity(Map rawData, String webHost) : super(rawData, webHost);
2018-10-27 14:27:41 +03:00
2018-10-28 20:01:01 +02:00
double get minValue => _getDoubleAttributeValue("min") ?? 0.0;
double get maxValue =>_getDoubleAttributeValue("max") ?? 100.0;
double get valueStep => _getDoubleAttributeValue("step") ?? 1.0;
2018-10-27 14:27:41 +03:00
@override
2018-11-14 13:14:45 +02:00
EntityHistoryConfig historyConfig = EntityHistoryConfig(
chartType: EntityHistoryWidgetType.numericState,
numericState: true
);
/*@override
2018-10-27 14:27:41 +03:00
Widget _buildStatePart(BuildContext context) {
return Expanded(
//width: 200.0,
child: Row(
children: <Widget>[
SliderStateWidget(
expanded: true,
),
2018-11-05 20:21:44 +02:00
SimpleEntityState(
expanded: false,
),
2018-10-27 14:27:41 +03:00
],
),
);
}
@override
Widget _buildStatePartForPage(BuildContext context) {
2018-11-05 20:21:44 +02:00
return SimpleEntityState(
expanded: false,
);
2018-11-14 13:14:45 +02:00
}*/
2018-10-27 14:27:41 +03:00
@override
Widget _buildAdditionalControlsForPage(BuildContext context) {
2018-11-15 15:57:17 +02:00
return SliderControlsWidget();
2018-10-27 14:27:41 +03:00
}
}