add ignore commands checkbox to expire metadata config (#1388)

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
pull/1392/head
Sami Salonen 2022-05-10 22:38:58 +03:00 committed by GitHub
parent 4375e05db0
commit 3553ba7a82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -15,9 +15,10 @@
:value="parsedAction.value"
@blur="(evt) => updateActionValue(evt.target.value)" />
<f7-list-item title="ignore state updates" checkbox :checked="ignoreStateUpdates" @change="(ev) => metadata.config['ignoreStateUpdates'] = new Boolean(ev.target.checked).toString()" />
<f7-list-item title="ignore commands" checkbox :checked="ignoreCommands" @change="(ev) => metadata.config['ignoreCommands'] = new Boolean(ev.target.checked).toString()" />
</f7-list>
<f7-block-footer class="param-description padding-left">
<small>After a different command or state update is received, perform the chosen action when the duration specified below has passed. The timer is reset if another state update or command is received before it expires. If the ignore state updates checkbox is set, only state changes will reset the timer.</small>
<small>After a different command or state update is received, perform the chosen action when the duration specified below has passed. The timer is reset if another state update or command is received before it expires. If the ignore state updates checkbox is set, only state changes will reset the timer. If the ignore commands checkbox is set, only state updates and state changes will reset the timer.</small>
</f7-block-footer>
<f7-block-title medium>
After
@ -79,6 +80,11 @@ export default {
let configValue = this.metadata.config['ignoreStateUpdates']
if (!configValue) return false
return typeof (configValue) === 'string' ? configValue === 'true' : configValue
},
ignoreCommands () {
let configValue = this.metadata.config['ignoreCommands']
if (!configValue) return false
return typeof (configValue) === 'string' ? configValue === 'true' : configValue
}
},
mounted () {