Relates to #248 old format support
This commit is contained in:
@ -453,9 +453,14 @@ class HomeAssistant {
|
|||||||
String tapAction = EntityTapAction.moreInfo;
|
String tapAction = EntityTapAction.moreInfo;
|
||||||
String holdAction = EntityTapAction.none;
|
String holdAction = EntityTapAction.none;
|
||||||
if (card.type == CardType.glance || card.type == CardType.entityButton) {
|
if (card.type == CardType.glance || card.type == CardType.entityButton) {
|
||||||
if (rawEntity["tap_action"] != null && !(rawEntity["tap_action"] is String)) {
|
if (rawEntity["tap_action"] != null) {
|
||||||
tapAction = rawEntity["tap_action"]["action"];
|
if (rawEntity["tap_action"] is String) {
|
||||||
holdAction = rawEntity["hold_action"]["action"];
|
tapAction = rawEntity["tap_action"];
|
||||||
|
holdAction = rawEntity["hold_action"];
|
||||||
|
} else {
|
||||||
|
tapAction = rawEntity["tap_action"]["action"];
|
||||||
|
holdAction = rawEntity["hold_action"]["action"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
card.entities.add(
|
card.entities.add(
|
||||||
@ -476,9 +481,14 @@ class HomeAssistant {
|
|||||||
var en = rawCard["entity"];
|
var en = rawCard["entity"];
|
||||||
String tapAction = EntityTapAction.moreInfo;
|
String tapAction = EntityTapAction.moreInfo;
|
||||||
String holdAction = EntityTapAction.none;
|
String holdAction = EntityTapAction.none;
|
||||||
if (rawCard["tap_action"] != null && !(rawCard["tap_action"] is String)) {
|
if (rawCard["tap_action"] != null) {
|
||||||
tapAction = rawCard["tap_action"]["action"];
|
if (rawCard["tap_action"] is String) {
|
||||||
holdAction = rawCard["hold_action"]["action"];
|
tapAction = rawCard["tap_action"];
|
||||||
|
holdAction = rawCard["hold_action"];
|
||||||
|
} else {
|
||||||
|
tapAction = rawCard["tap_action"]["action"];
|
||||||
|
holdAction = rawCard["hold_action"]["action"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (en is String) {
|
if (en is String) {
|
||||||
if (entities.isExist(en)) {
|
if (entities.isExist(en)) {
|
||||||
|
Reference in New Issue
Block a user