Fix light controls issues
This commit is contained in:
parent
a4477e9f83
commit
2836973dca
@ -45,7 +45,7 @@ class HACard {
|
|||||||
|
|
||||||
List<EntityWrapper> getEntitiesToShow() {
|
List<EntityWrapper> getEntitiesToShow() {
|
||||||
return entities.where((entityWrapper) {
|
return entities.where((entityWrapper) {
|
||||||
if (entityWrapper.entity.isHidden) {
|
if (!ConnectionManager().useLovelace && entityWrapper.entity.isHidden) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (stateFilter.isNotEmpty) {
|
if (stateFilter.isNotEmpty) {
|
||||||
|
@ -143,10 +143,16 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
|
|||||||
|
|
||||||
Widget _buildColorTempControl(LightEntity entity) {
|
Widget _buildColorTempControl(LightEntity entity) {
|
||||||
if (entity.supportColorTemp) {
|
if (entity.supportColorTemp) {
|
||||||
|
double val = entity.minMireds;
|
||||||
|
if (_tmpColorTemp != null) {
|
||||||
|
if (_tmpColorTemp >= entity.minMireds && _tmpColorTemp <= entity.maxMireds) {
|
||||||
|
val = _tmpColorTemp.toDouble();
|
||||||
|
}
|
||||||
|
}
|
||||||
return UniversalSlider(
|
return UniversalSlider(
|
||||||
title: "Color temperature",
|
title: "Color temperature",
|
||||||
leading: Text("Cold", style: TextStyle(color: Colors.lightBlue),),
|
leading: Text("Cold", style: TextStyle(color: Colors.lightBlue),),
|
||||||
value: _tmpColorTemp == null ? entity.maxMireds : _tmpColorTemp.toDouble(),
|
value: val,
|
||||||
onChangeEnd: (value) => _setColorTemp(entity, value),
|
onChangeEnd: (value) => _setColorTemp(entity, value),
|
||||||
max: entity.maxMireds,
|
max: entity.maxMireds,
|
||||||
min: entity.minMireds,
|
min: entity.minMireds,
|
||||||
@ -203,10 +209,14 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
|
|||||||
|
|
||||||
Widget _buildEffectControl(LightEntity entity) {
|
Widget _buildEffectControl(LightEntity entity) {
|
||||||
if ((entity.supportEffect) && (entity.effectList != null)) {
|
if ((entity.supportEffect) && (entity.effectList != null)) {
|
||||||
|
List<String> list = List.from(entity.effectList);
|
||||||
|
if (!list.contains(_tmpEffect)) {
|
||||||
|
list.insert(0, _tmpEffect);
|
||||||
|
}
|
||||||
return ModeSelectorWidget(
|
return ModeSelectorWidget(
|
||||||
onChange: (effect) => _setEffect(entity, effect),
|
onChange: (effect) => _setEffect(entity, effect),
|
||||||
caption: "Effect",
|
caption: "Effect",
|
||||||
options: entity.effectList,
|
options: list,
|
||||||
value: _tmpEffect
|
value: _tmpEffect
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
18
pubspec.lock
18
pubspec.lock
@ -91,7 +91,7 @@ packages:
|
|||||||
name: device_info
|
name: device_info
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.0+2"
|
version: "0.4.0+3"
|
||||||
event_bus:
|
event_bus:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -138,7 +138,7 @@ packages:
|
|||||||
name: flutter_local_notifications
|
name: flutter_local_notifications
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.3"
|
version: "0.8.4"
|
||||||
flutter_markdown:
|
flutter_markdown:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -199,7 +199,7 @@ packages:
|
|||||||
name: intl
|
name: intl
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.15.8"
|
version: "0.16.0"
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -220,7 +220,7 @@ packages:
|
|||||||
name: markdown
|
name: markdown
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.1.1"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -318,7 +318,7 @@ packages:
|
|||||||
name: sqflite
|
name: sqflite
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.6+4"
|
version: "1.1.7+1"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -374,7 +374,7 @@ packages:
|
|||||||
name: url_launcher
|
name: url_launcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.1.3"
|
version: "5.1.4"
|
||||||
uuid:
|
uuid:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -409,7 +409,7 @@ packages:
|
|||||||
name: yaml
|
name: yaml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.16"
|
version: "2.2.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.4.0 <3.0.0"
|
dart: ">=2.5.0 <3.0.0"
|
||||||
flutter: ">=1.5.0 <2.0.0"
|
flutter: ">=1.9.1 <2.0.0"
|
||||||
|
@ -24,8 +24,8 @@ dependencies:
|
|||||||
firebase_messaging: ^5.1.6
|
firebase_messaging: ^5.1.6
|
||||||
flutter_webview_plugin: ^0.3.8
|
flutter_webview_plugin: ^0.3.8
|
||||||
flutter_secure_storage: ^3.3.1+1
|
flutter_secure_storage: ^3.3.1+1
|
||||||
device_info: ^0.4.0+2
|
device_info: ^0.4.0+3
|
||||||
flutter_local_notifications: ^0.8.3
|
flutter_local_notifications: ^0.8.4
|
||||||
share:
|
share:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/d-silveira/flutter-share.git
|
url: https://github.com/d-silveira/flutter-share.git
|
||||||
|
Reference in New Issue
Block a user