Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

fix: enable arm buttons based on supported alarm features #473

Merged
merged 3 commits into from
Oct 18, 2020

Conversation

rchl
Copy link
Collaborator

@rchl rchl commented Oct 12, 2020

Resolves #365

@rchl
Copy link
Collaborator Author

rchl commented Oct 13, 2020

@akloeckner Care to review?

@akloeckner
Copy link
Contributor

Sure! I'll be able to test earliest Thursday, though...

Copy link
Contributor

@akloeckner akloeckner left a comment

Choose a reason for hiding this comment

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

Actually, my manual alarm panel supports all those features. So, not much to test in the end. Looks good!

If we were to clean up while passing by, I'd fix up the isDisarmed function to simply

return entity.state != 'disarmed';

@rchl
Copy link
Collaborator Author

rchl commented Oct 16, 2020

Removed isDisarmed. It doesn't add much and I would prefer to have as few scope methods as possible.

@akloeckner
Copy link
Contributor

👍 My parameter for a good PR also is "more lines removed than added". ;-)

Just a logical twist, that strikes my mind: Is it really correct to enable the arm actions only, if the alarm is already armed. (And vice versa.) It seems to work correctly, but I don't understand, why...

@rchl
Copy link
Collaborator Author

rchl commented Oct 16, 2020

No, you are right. It's backwards and doesn't work as intended. Will fix.

Copy link
Contributor

@akloeckner akloeckner left a comment

Choose a reason for hiding this comment

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

I hope you weren't waiting for my approval...

@rchl rchl merged commit 31d5a5a into master Oct 18, 2020
@rchl
Copy link
Collaborator Author

rchl commented Oct 18, 2020

Was planning to merge eventually but was not in a rush. :)

@rchl rchl deleted the fix/alarm-feature branch October 18, 2020 18:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customize alarm action selection
2 participants