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: use same entity icons rules as home assistant frontend #147

Merged
merged 2 commits into from
Feb 24, 2022

Conversation

piitaya
Copy link
Owner

@piitaya piitaya commented Feb 20, 2022

https://github.com/custom-cards/custom-card-helpers is not very active. I imported the icon rules from HA front-end.

fix #87
fix #125
fix #145

@piitaya piitaya requested a review from bemble February 20, 2022 18:15
Comment on lines 1 to 22
export const alarmPanelIcon = (state?: string) => {
switch (state) {
case "armed_away":
return "mdi:shield-lock";
case "armed_vacation":
return "mdi:shield-airplane";
case "armed_home":
return "mdi:shield-home";
case "armed_night":
return "mdi:shield-moon";
case "armed_custom_bypass":
return "mdi:security";
case "pending":
return "mdi:shield-outline";
case "triggered":
return "mdi:bell-ring";
case "disarmed":
return "mdi:shield-off";
default:
return "mdi:shield";
}
};
Copy link
Owner Author

@piitaya piitaya Feb 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bemble Do you think we must replace our custom alarm panel icons with these rules ?

// from src/cards/alarm-control-panel-card/const.ts
export const ALARM_CONTROL_PANEL_CARD_STATE_ICON = {
    disarmed: "mdi:shield-off-outline",
    arming: "mdi:shield-sync-outline",
    armed_away: "mdi:shield-lock-outline",
    armed_home: "mdi:shield-home-outline",
    armed_night: "mdi:shield-moon-outline",
    armed_vacation: "mdi:shield-airplane-outline",
    armed_custom_bypass: "mdi:shield-half-full",
    pending: "mdi:shield-sync",
    triggered: "mdi:bell-ring-outline",
    unavailable: "mdi:bell-remove-outline",
};

Copy link
Collaborator

@bemble bemble Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No prob for me, just the pending icon, the one I choose is better in my opinion 😛

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add your unavailable icon too 😊

@piitaya piitaya changed the title fix: use same entity icons rules than home assitant frontend fix: use same entity icons rules as home assistant frontend Feb 20, 2022
@piitaya piitaya added the bug Something isn't working label Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants