-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Use "arming" state during transition in manual alarm panel #32950
Conversation
I think the failed check has nothing to do with this PR, can someone confirm? |
Please describe the background for this change, not only what the change is. |
@MartinHjelmare I just updated the discription to tell a bit more about the background |
The pending time config option is used for both the pending time and the arming time. Is that ok? |
I think that is okay since you can control the transition times between each mode individually anyway (see docs). For example this config will ensure "arming" state for 60 seconds and "pending" state for 10 seconds, but in principle all these timings can be set for each state (also "armed_home" "armed_away" etc.):
|
The configuration already treats these two things as different, so I think it is good to support different states. It is much more intuitive to the user. However, in configuring this according to the documentation, |
Currently this would be configured:
I would propose that |
@MatthewFlamm I agree, I will start changing it |
@MatthewFlamm I cannot change the configuration variable names since they are imported from HomeAssistant const.py, Other platforms might be using those same variable names and changing those would probably require discussion about the Home Assistant architecture. Therefore I propose changing the configuration varibale names (delay_time is kept but pending_time would be renamed to arming_time), is left for a seprate PR. |
You can create a new variable. I don't think there should be two breaking changes however this is implemented. manual_mqtt operates the same way and would presumably also need to be changed to match. |
I will work on it tonight |
@MatthewFlamm @MartinHjelmare I think this is now ready to merge. |
@MartinHjelmare I commited the changes that you requested. |
It would be good to change to async api for the whole platform, as it doesn't do any I/O anyway, but that's for another PR. |
Co-Authored-By: Martin Hjelmare <[email protected]>
@MartinHjelmare any more sugestions, or can the "changes requested" be marked as done? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Since this a quite big breaking change, and it's for alarm devices, I'd like a second opinion before merge.
This change looks good. We should also update the device triggers which still use |
@balloob what do you mean with "device triggers", is that something in the manual alarm panel or in which files should that be changed? |
alarm_control_panel/device_triggers.py |
@balloob I added the "arming" state to the device triggers. I also made a review with some questions about the device triggers |
@MartinHjelmare could you take a look at why the python tests stopped? Can this be merged now? |
I restarted the tests. |
@MartinHjelmare yes now it passed, thanks for the restart! Can this now be merged? |
Good! |
Breaking change
Manual Alarm Control Panel
When going from state "disarmed" to any other (armed) state such as "armed_away", the state will be "arming" instead of "pending" during the transition time as set in the configuration.
When going from an armed state (such as "armed_away") to the "triggered" state the state will still be "pending" during the transition time as set in the configuration (as it was before).
State attribute "pre_pending_state" changed to "previous_state"
State attribute "post_pending_state" changed to "next_state"
config option "pending_time" is renamed to "arming_time", functionality is the same
The time the alarm stays at "pending" when triggered has changed from delay_time of the previous state + arming_time(previously known as pending_time) of the triggered state to only the delay_time of the previous state
Proposed change
Manual Alarm Control Panel
When going from state "disarmed" to any other (armed) state such as "armed_away", the state will be "arming" instead of "pending" during the transition time as set in the configuration.
When going from an armed state (such as "armed_away") to the "triggered" state the state will still be "pending" during the transition time as set in the configuration (as it was before).
This can be usefull if you want to activate a warning before an alarm goes off, for instance:
Make an automation that triggers on the "pending" status and sends a text to speach message anounching that "You have 10 seconds to disable the alarm", and then activat the actual alarm on the "triggered" state.
Of course you do not want this tts anaounchment when arming the device, therefore when arming the device a diffrent state needs to be used which will be "arming".
Besides since HomeAssistant supports the "arming" state it is probably better for uniformity to actualy use the "arming" state when arming the alarm instead of the "pending" state which is used when an alarm is pending (about to go to triggerd).
Docs PR:
home-assistant/home-assistant.io#12531
Type of change
Example entry for
configuration.yaml
:# Example configuration.yaml
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: