Fix icon_height parsing issue
This commit is contained in:
@ -292,8 +292,8 @@ class ButtonCardData extends CardData {
|
|||||||
showName = rawData['show_name'] ?? true;
|
showName = rawData['show_name'] ?? true;
|
||||||
showIcon = rawData['show_icon'] ?? true;
|
showIcon = rawData['show_icon'] ?? true;
|
||||||
stateColor = rawData['state_color'] ?? true;
|
stateColor = rawData['state_color'] ?? true;
|
||||||
if (rawData.containsKey('icon_height')) {
|
var rawHeight = rawData['icon_height'];
|
||||||
String rawHeight = rawData['icon_height'];
|
if (rawHeight != null && rawHeight is String) {
|
||||||
if (rawHeight.contains('px')) {
|
if (rawHeight.contains('px')) {
|
||||||
iconHeightPx = double.tryParse(rawHeight.replaceFirst('px', '')) ?? 0;
|
iconHeightPx = double.tryParse(rawHeight.replaceFirst('px', '')) ?? 0;
|
||||||
} else if (rawHeight.contains('rem')) {
|
} else if (rawHeight.contains('rem')) {
|
||||||
@ -507,4 +507,4 @@ class MediaControlCardData extends CardData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user