Resolves #132
This commit is contained in:
parent
758376a891
commit
85379cf491
@ -579,7 +579,7 @@ class _ClimateControlWidgetState extends State<ClimateControlWidget> {
|
||||
|
||||
Widget _buildTemperatureControls(ClimateEntity entity) {
|
||||
List<Widget> result = [];
|
||||
if (entity.supportTargetTemperature) {
|
||||
if ((entity.supportTargetTemperature) && (entity.temperature != null)) {
|
||||
result.addAll(<Widget>[
|
||||
Text(
|
||||
"$_tmpTemperature",
|
||||
@ -617,7 +617,7 @@ class _ClimateControlWidgetState extends State<ClimateControlWidget> {
|
||||
],
|
||||
)
|
||||
]);
|
||||
} else if (entity.supportTargetTemperatureHigh && entity.supportTargetTemperatureLow) {
|
||||
} else if (entity.supportTargetTemperatureHigh && entity.supportTargetTemperatureLow && (entity.targetHigh != null) && (entity.targetLow != null)) {
|
||||
result.addAll(<Widget>[
|
||||
Text(
|
||||
"$_tmpTargetLow",
|
||||
@ -913,7 +913,7 @@ class _CoverControlWidgetState extends State<CoverControlWidget> {
|
||||
List<Widget> controls = [];
|
||||
if (entity.supportCloseTilt || entity.supportOpenTilt || entity.supportStopTilt) {
|
||||
controls.add(
|
||||
CoverEntityTiltControlState()
|
||||
CoverEntityTiltControlButtons()
|
||||
);
|
||||
}
|
||||
if (entity.supportSetTiltPosition) {
|
||||
|
@ -333,6 +333,15 @@ class ClimateStateWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final entityModel = EntityModel.of(context);
|
||||
final ClimateEntity entity = entityModel.entity;
|
||||
String targetTemp = "-";
|
||||
if ((entity.supportTargetTemperature) && (entity.temperature!=null)) {
|
||||
targetTemp = "${entity.temperature}";
|
||||
} else if ((entity.supportTargetTemperatureLow) && (entity.targetLow != null)) {
|
||||
targetTemp = "${entity.targetLow}";
|
||||
if ((entity.supportTargetTemperatureHigh) && (entity.targetHigh != null)) {
|
||||
targetTemp += " - ${entity.targetHigh}";
|
||||
}
|
||||
}
|
||||
return Padding(
|
||||
padding:
|
||||
EdgeInsets.fromLTRB(0.0, 0.0, entityModel.entity.rightWidgetPadding, 0.0),
|
||||
@ -350,7 +359,7 @@ class ClimateStateWidget extends StatelessWidget {
|
||||
fontSize: entityModel.entity.stateFontSize,
|
||||
)),
|
||||
Text(
|
||||
entity.supportTargetTemperature ? " ${entity.temperature}" : " ${entity.targetLow} - ${entity.targetHigh}",
|
||||
" $targetTemp",
|
||||
textAlign: TextAlign.right,
|
||||
style: new TextStyle(
|
||||
fontSize: entityModel.entity.stateFontSize,
|
||||
@ -502,7 +511,7 @@ class CoverEntityControlState extends StatelessWidget {
|
||||
|
||||
}
|
||||
|
||||
class CoverEntityTiltControlState extends StatelessWidget {
|
||||
class CoverEntityTiltControlButtons extends StatelessWidget {
|
||||
|
||||
void _open(CoverEntity entity) {
|
||||
eventBus.fire(new ServiceCallEvent(entity.domain, "open_cover_tilt", entity.entityId, null));
|
||||
|
@ -30,7 +30,7 @@ part 'card_class.dart';
|
||||
|
||||
EventBus eventBus = new EventBus();
|
||||
const String appName = "HA Client";
|
||||
const appVersion = "0.3.0.38";
|
||||
const appVersion = "0.3.0.39";
|
||||
|
||||
String homeAssistantWebHost;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: hass_client
|
||||
description: Home Assistant Android Client
|
||||
|
||||
version: 0.3.0+38
|
||||
version: 0.3.0+39
|
||||
|
||||
environment:
|
||||
sdk: ">=2.0.0-dev.68.0 <3.0.0"
|
||||
|
Reference in New Issue
Block a user