Show error when media_player is not media_player

This commit is contained in:
Yegor Vialov
2020-05-02 08:50:21 +00:00
parent 0996fb94da
commit 96c8338890
4 changed files with 33 additions and 1 deletions

View File

@ -13,6 +13,14 @@ class MediaControlsCard extends StatelessWidget {
child: MissedEntityWidget(),
handleTap: false,
);
} else if (card.entity.entity.domain == null || card.entity.entity.domain != 'media_player') {
return EntityModel(
entityWrapper: card.entity,
child: ErrorEntityWidget(
text: '${card.entity.entity?.entityId} is not a media_player',
),
handleTap: false,
);
}
return CardWrapper(
child: EntityModel(