1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

Add MPR121 Capacitive Touch Sensor (#449)

* module mpr121

* added mpr121 sensor and binary sensor

* added tests

* removed CONF_CHANNELS, it is not supported in the esphome-code mpr121
code

* changed namespace for mpr121 to binary_sensor

* Update esphome/components/binary_sensor/mpr121.py

Co-Authored-By: mvturnho <qris.online@gmail.com>

* fixed class names

* fix lint errors
This commit is contained in:
Michiel van Turnhout
2019-02-24 21:48:28 +01:00
committed by Otto Winter
parent 2e5fd7e90d
commit 92f8b043ce
4 changed files with 85 additions and 0 deletions

View File

@@ -102,6 +102,10 @@ time:
apds9960:
address: 0x20
update_interval: 60s
mpr121:
id: mpr121_first
address: 0x5A
binary_sensor:
- platform: apds9960
@@ -119,6 +123,23 @@ binary_sensor:
- platform: homeassistant
entity_id: binary_sensor.hello_world
id: ha_hello_world_binary
#mpr121
- platform: mpr121
id: touchkey0
channel: 0
name: "touchkey0"
- platform: mpr121
channel: 1
name: "touchkey1"
- platform: mpr121
channel: 2
name: "touchkey2"
- platform: mpr121
channel: 3
name: "touchkey3"
on_press:
then:
- switch.toggle: mpr121_toggle
remote_receiver:
pin: GPIO12
@@ -158,6 +179,12 @@ script:
then:
- lambda: 'ESP_LOGD("main", "Hello World!");'
switch:
- platform: template
name: "mpr121_toggle"
id: mpr121_toggle
optimistic: True
stepper:
- platform: uln2003
id: my_stepper