domofon moved to esphome

This commit is contained in:
Your Name
2019-12-01 21:48:35 +03:00
parent 089ecc0858
commit 59ec8b2790
7 changed files with 135 additions and 21 deletions
@@ -29,7 +29,14 @@ class Intercom(hass.Hass):
self.ringtone = self.args['ringtone']
self.listen_event(self.domofon_call, "domofon_call")
self.listen_event(self.receive_telegram_callback, 'telegram_callback')
# self.domofon_call(None, None, None)
self.listen_state(self.sensor_trigger, self.args['sensor'])
def sensor_trigger(self, entity, attribute, old, new, kwargs):
if new != "off":
return
self.log("domofon_call")
self.domofon_call(None, None, None)
def domofon_call(self, event_id, event_args, kwargs):
self.log("domofon_call")
@@ -5,6 +5,7 @@ intercom:
module: intercom
class: Intercom
notify: telegram
sensor: binary_sensor.domofon_incoming_call
gw_mac: !secret aqara1_mac
chat_id: !secret telegram_group_chat
global_dependencies: