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

Add rc522 i2c (#1432)

* split to spi and i2c

* fix binary_sensor

* i2c comms ready

* fix rc522_spi binary sensor compat

* lint

* lint

* add test and codeowners

* fix refactor
This commit is contained in:
Guillermo Ruffino
2021-01-12 10:13:53 -03:00
committed by GitHub
parent 400819175d
commit fbc1b3e316
13 changed files with 1359 additions and 1092 deletions

View File

@@ -201,7 +201,7 @@ mcp23s08:
- id: 'mcp23s08_hub'
cs_pin: GPIO12
deviceaddress: 0
mcp23s17:
- id: 'mcp23s17_hub'
cs_pin: GPIO12
@@ -813,7 +813,7 @@ esp32_touch:
binary_sensor:
- platform: gpio
name: "MCP23S08 Pin #1"
name: 'MCP23S08 Pin #1'
pin:
mcp23s08: mcp23s08_hub
# Use pin number 1
@@ -822,7 +822,7 @@ binary_sensor:
mode: INPUT_PULLUP
inverted: False
- platform: gpio
name: "MCP23S17 Pin #1"
name: 'MCP23S17 Pin #1'
pin:
mcp23s17: mcp23s17_hub
# Use pin number 1
@@ -1391,7 +1391,7 @@ climate:
switch:
- platform: gpio
name: "MCP23S08 Pin #0"
name: 'MCP23S08 Pin #0'
pin:
mcp23s08: mcp23s08_hub
# Use pin number 0
@@ -1399,7 +1399,7 @@ switch:
mode: OUTPUT
inverted: False
- platform: gpio
name: "MCP23S17 Pin #0"
name: 'MCP23S17 Pin #0'
pin:
mcp23s17: mcp23s17_hub
# Use pin number 0
@@ -1823,6 +1823,12 @@ rc522_spi:
- lambda: |-
ESP_LOGD("main", "Found tag %s", x.c_str());
rc522_i2c:
update_interval: 1s
on_tag:
- lambda: |-
ESP_LOGD("main", "Found tag %s", x.c_str());
gps:
time:
@@ -1933,7 +1939,7 @@ text_sensor:
value: '0'
- canbus.send:
can_id: 23
data: [ 0x10, 0x20, 0x30 ]
data: [0x10, 0x20, 0x30]
- platform: template
name: Template Text Sensor
id: template_text
@@ -1967,15 +1973,15 @@ canbus:
can_id: 4
bit_rate: 50kbps
on_frame:
- can_id: 500
then:
- lambda: |-
std::string b(x.begin(), x.end());
ESP_LOGD("canid 500", "%s", &b[0] );
- can_id: 23
then:
- if:
condition:
lambda: 'return x[0] == 0x11;'
then:
light.toggle: living_room_lights
- can_id: 500
then:
- lambda: |-
std::string b(x.begin(), x.end());
ESP_LOGD("canid 500", "%s", &b[0] );
- can_id: 23
then:
- if:
condition:
lambda: 'return x[0] == 0x11;'
then:
light.toggle: living_room_lights