mirror of
https://github.com/Anonym-tsk/smart-domofon.git
synced 2025-12-10 13:37:00 +03:00
Open / Reject buttons
This commit is contained in:
@@ -59,5 +59,6 @@ packages:
|
|||||||
script: !include domofon_packages/script.yaml
|
script: !include domofon_packages/script.yaml
|
||||||
output: !include domofon_packages/output.yaml
|
output: !include domofon_packages/output.yaml
|
||||||
switch: !include domofon_packages/switch.yaml
|
switch: !include domofon_packages/switch.yaml
|
||||||
|
button: !include domofon_packages/button.yaml
|
||||||
light: !include domofon_packages/light.yaml
|
light: !include domofon_packages/light.yaml
|
||||||
binary_sensor: !include domofon_packages/binary_sensor.yaml
|
binary_sensor: !include domofon_packages/binary_sensor.yaml
|
||||||
|
|||||||
26
ge1mer/domofon_packages/button.yaml
Normal file
26
ge1mer/domofon_packages/button.yaml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
button:
|
||||||
|
# Accept call
|
||||||
|
- platform: template
|
||||||
|
name: "${board_name} accept call"
|
||||||
|
icon: "mdi:door-open"
|
||||||
|
on_press:
|
||||||
|
if:
|
||||||
|
condition:
|
||||||
|
binary_sensor.is_on: incoming_call
|
||||||
|
then:
|
||||||
|
script.execute: call_accept
|
||||||
|
else:
|
||||||
|
logger.log: "No incoming call"
|
||||||
|
|
||||||
|
# Reject call
|
||||||
|
- platform: template
|
||||||
|
name: "${board_name} reject call"
|
||||||
|
icon: "mdi:door-closed-lock"
|
||||||
|
on_press:
|
||||||
|
if:
|
||||||
|
condition:
|
||||||
|
binary_sensor.is_on: incoming_call
|
||||||
|
then:
|
||||||
|
script.execute: call_reject
|
||||||
|
else:
|
||||||
|
logger.log: "No incoming call"
|
||||||
@@ -133,33 +133,3 @@ switch:
|
|||||||
- output.turn_on: relay_phone
|
- output.turn_on: relay_phone
|
||||||
- output.turn_off: relay_mute
|
- output.turn_off: relay_mute
|
||||||
- script.execute: state_no_call
|
- script.execute: state_no_call
|
||||||
|
|
||||||
# Accept call
|
|
||||||
- platform: template
|
|
||||||
name: "${board_name} accept call"
|
|
||||||
icon: "mdi:door-open"
|
|
||||||
lambda: "return false;"
|
|
||||||
optimistic: true
|
|
||||||
turn_on_action:
|
|
||||||
if:
|
|
||||||
condition:
|
|
||||||
binary_sensor.is_on: incoming_call
|
|
||||||
then:
|
|
||||||
script.execute: call_accept
|
|
||||||
else:
|
|
||||||
logger.log: "No incoming call"
|
|
||||||
|
|
||||||
# Reject call
|
|
||||||
- platform: template
|
|
||||||
name: "${board_name} reject call"
|
|
||||||
icon: "mdi:door-closed-lock"
|
|
||||||
lambda: "return false;"
|
|
||||||
optimistic: true
|
|
||||||
turn_on_action:
|
|
||||||
if:
|
|
||||||
condition:
|
|
||||||
binary_sensor.is_on: incoming_call
|
|
||||||
then:
|
|
||||||
script.execute: call_reject
|
|
||||||
else:
|
|
||||||
logger.log: "No incoming call"
|
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ automation:
|
|||||||
callback_query_id: "{{ trigger.event.data.id }}"
|
callback_query_id: "{{ trigger.event.data.id }}"
|
||||||
message: "Открываю..."
|
message: "Открываю..."
|
||||||
# Открыть
|
# Открыть
|
||||||
- service: switch.turn_on
|
- service: button.press
|
||||||
entity_id: switch.domofon_accept_call
|
entity_id: button.domofon_accept_call
|
||||||
default:
|
default:
|
||||||
# Отправить ответ, что нету звонка
|
# Отправить ответ, что нету звонка
|
||||||
- service: telegram_bot.answer_callback_query
|
- service: telegram_bot.answer_callback_query
|
||||||
@@ -96,9 +96,9 @@ automation:
|
|||||||
data_template:
|
data_template:
|
||||||
callback_query_id: "{{ trigger.event.data.id }}"
|
callback_query_id: "{{ trigger.event.data.id }}"
|
||||||
message: "Отклоняю..."
|
message: "Отклоняю..."
|
||||||
# Открыть
|
# Отклонить
|
||||||
- service: switch.turn_on
|
- service: button.press
|
||||||
entity_id: switch.domofon_reject_call
|
entity_id: button.domofon_reject_call
|
||||||
default:
|
default:
|
||||||
# Отправить ответ, что нету звонка
|
# Отправить ответ, что нету звонка
|
||||||
- service: telegram_bot.answer_callback_query
|
- service: telegram_bot.answer_callback_query
|
||||||
|
|||||||
Reference in New Issue
Block a user