Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hide_when_no_warning #181

Merged
merged 1 commit into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/meteoalarm-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ export class MeteoalarmCard extends LitElement {
);

// Handle hide_when_no_warning
if(events.length == 0 && this.config.hide_when_no_warning) {
if(events.every(e => !e.isActive) && this.config.hide_when_no_warning) {
// eslint-disable-next-line no-console
console.log('MeteoalarmCard: Card is hidden since hide_when_no_warning is enabled and there are no warnings');
console.log('MeteoalarmCard: Card is hidden - hide_when_no_warning is enabled and there are no warnings');
this.setCardMargin(false);
return html``;
}
Expand Down
2 changes: 1 addition & 1 deletion src/predefined-cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MeteoalarmAlertParsed, MeteoalarmLevelType } from './types';
export class PredefinedCards {
public static unavailableCard(): MeteoalarmAlertParsed {
return {
isActive: false,
isActive: true,
entity: undefined,
icon: 'cloud-question',
color: MeteoalarmData.getLevel(MeteoalarmLevelType.None).color,
Expand Down