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

Adding Alarm Panel to Lovelace #1758

Merged
merged 10 commits into from Oct 15, 2018
Merged

Conversation

zsarnett
Copy link
Contributor

@zsarnett zsarnett commented Oct 12, 2018

Adds a new card type alarm-panel to the available cards

Card uses the Previously made Custom Card located here

Configuration Variables

Name Type Default Description
type string Required alarm-panel
entity string Required An entity_id from alarm_control_panel domain. Example: alarm_control_panel.alarm
title string Current Arm State Card Title
states list arm_home, arm_away A list of possible arm buttons. Supports arm_home, arm_away, arm_night, arm_custom_bypass.

Example

- type: alarm-panel
  entity: alarm_control_panel.alarm
- type: alarm-panel
  entity: alarm_control_panel.alarm
  title: House Alarm
  states:
    - arm_home

Example

@zsarnett
Copy link
Contributor Author

zsarnett commented Oct 12, 2018

When running eslint I am receiving error Expected an assignment or function call and instead saw an expression no-unused-expressions on Line 217

Not sure on how to fix this in the best way

@zsarnett zsarnett changed the title Adding Alarm Panel to Lovelace WIP:Adding Alarm Panel to Lovelace Oct 12, 2018
@jeradM
Copy link
Member

jeradM commented Oct 12, 2018

Your ternary expression should return a value, not an assignment. Just use an if-else

@zsarnett zsarnett changed the title WIP:Adding Alarm Panel to Lovelace Adding Alarm Panel to Lovelace Oct 12, 2018
@zsarnett zsarnett closed this Oct 12, 2018
@zsarnett zsarnett reopened this Oct 12, 2018
@ghost ghost added in progress and removed in progress labels Oct 12, 2018
@zsarnett
Copy link
Contributor Author

Wrong button..

@zsarnett
Copy link
Contributor Author

zsarnett commented Oct 12, 2018

Not sure how to get travis to kick in here @jeradM

@balloob
Copy link
Member

balloob commented Oct 12, 2018

The text of pending under the card header should be left aligned with the header text.

@balloob
Copy link
Member

balloob commented Oct 12, 2018

I am wondering, would it make sense to use a <ha-state-label-badge> on the top right? That way we can add "home" or "away" when it's armed.

@balloob
Copy link
Member

balloob commented Oct 12, 2018

Then we can drop the red text under title (which looks a bit weird)

@zsarnett
Copy link
Contributor Author

zsarnett commented Oct 13, 2018

In light of making things simple, I went with only showing the states that don't overflow in the label.

If you think its not clean/user friendly enough I am still working on getting a better label created but it just takes a lot of css

Updated the Gif Example above for the new Icon

src/panels/lovelace/cards/hui-alarm-panel-card.js Outdated Show resolved Hide resolved
src/panels/lovelace/cards/hui-alarm-panel-card.js Outdated Show resolved Hide resolved
src/panels/lovelace/cards/hui-alarm-panel-card.js Outdated Show resolved Hide resolved
src/panels/lovelace/cards/hui-alarm-panel-card.js Outdated Show resolved Hide resolved
src/panels/lovelace/cards/hui-alarm-panel-card.js Outdated Show resolved Hide resolved
@balloob
Copy link
Member

balloob commented Oct 13, 2018

I really like the ha-label-badge look !

@zsarnett zsarnett force-pushed the alarm-panel branch 2 times, most recently from 63c6789 to 41540ef Compare October 14, 2018 05:29
@zsarnett
Copy link
Contributor Author

Seems to be failing because the gauge and sensor card directories are not in my build? I need restart with a new fork after this PR. Made the mistake of developing the gauge card on the master instead of a branch. and now everything is so messed up an I have tried merging and rebasing but it then trys to commit everything to this branch which throws this PR all to hell

@zsarnett zsarnett force-pushed the alarm-panel branch 2 times, most recently from 981be75 to 4579663 Compare October 14, 2018 23:30
Copy link
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

Ok to merge when few small comments addressed

@balloob
Copy link
Member

balloob commented Oct 15, 2018

Can you align the icon in the badge with the baseline of the header

screen shot 2018-10-15 at 1 08 47 pm

@balloob balloob merged commit 48f6d1d into home-assistant:master Oct 15, 2018
@ghost ghost removed the in progress label Oct 15, 2018
@zsarnett zsarnett deleted the alarm-panel branch September 2, 2020 02:46
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants