From 1f8ecd46a64e13787cba343c4adf649322b11bdd Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 4 Nov 2021 07:55:26 +1300 Subject: [PATCH] Convert pin mode examples to new format (#1591) --- components/binary_sensor/gpio.rst | 4 ++- components/climate/ir_climate.rst | 4 ++- components/display/st7789v.rst | 4 ++- components/mcp230xx.rst | 19 +++++++++----- components/mcp23Sxx.rst | 13 +++++++--- components/output/ac_dimmer.rst | 3 ++- components/pcf8574.rst | 3 ++- components/remote_receiver.rst | 4 ++- components/sx1509.rst | 7 ++++-- .../brilliant-mirabella-genio-smart-plugs.rst | 24 ++++++++++++------ cookbook/esw01-eu.rst | 6 +++-- cookbook/ilonda-wifi-smart-fish-feeder.rst | 6 +++-- cookbook/sonoff-basic-light-switch.rst | 4 ++- cookbook/sonoff-dual-light-switch.rst | 16 +++++++++--- cookbook/sonoff-fishpond-pump.rst | 4 ++- cookbook/sonoff-t1-3.rst | 25 +++++++++++++------ devices/sonoff_4ch.rst | 16 +++++++++--- devices/sonoff_4ch.yaml | 16 +++++++++--- devices/sonoff_basic.rst | 4 ++- devices/sonoff_s20.rst | 4 ++- devices/sonoff_s20.yaml | 4 ++- devices/sonoff_t1_uk_3gang_v1.1.rst | 12 ++++++--- devices/sonoff_t1_uk_3gang_v1.1.yaml | 12 ++++++--- devices/sonoff_t3_eu_3gang_v1.0.rst | 12 ++++++--- devices/sonoff_t3_eu_3gang_v1.0.yaml | 12 ++++++--- devices/teckin.yaml | 4 ++- guides/getting_started_command_line.rst | 6 +++-- guides/getting_started_hassio.rst | 4 ++- 28 files changed, 182 insertions(+), 70 deletions(-) diff --git a/components/binary_sensor/gpio.rst b/components/binary_sensor/gpio.rst index 7c856bd67..7c869459f 100644 --- a/components/binary_sensor/gpio.rst +++ b/components/binary_sensor/gpio.rst @@ -44,7 +44,9 @@ you can do so with the :ref:`Pin Schema `. - platform: gpio pin: number: D2 - mode: INPUT_PULLUP + mode: + input: true + pullup: true name: ... Inverting Values diff --git a/components/climate/ir_climate.rst b/components/climate/ir_climate.rst index b4e8b0f04..4152dfa6e 100755 --- a/components/climate/ir_climate.rst +++ b/components/climate/ir_climate.rst @@ -126,7 +126,9 @@ IR receiver. pin: number: GPIO14 inverted: true - mode: INPUT_PULLUP + mode: + input: true + pullup: true # high 55% tolerance is recommended for some remote control units tolerance: 55% diff --git a/components/display/st7789v.rst b/components/display/st7789v.rst index a31af4619..a0b52a5ee 100644 --- a/components/display/st7789v.rst +++ b/components/display/st7789v.rst @@ -201,7 +201,9 @@ appropriate lines of C code in the lambda to hide or show the image or text as y pin: number: GPIO0 inverted: true - mode: INPUT_PULLUP + mode: + input: true + pullup: true name: "T-Display Button Input 0" id: tdisplay_button_input_0 - platform: gpio diff --git a/components/mcp230xx.rst b/components/mcp230xx.rst index fe9300dd3..bd6b00dc4 100644 --- a/components/mcp230xx.rst +++ b/components/mcp230xx.rst @@ -36,7 +36,8 @@ The MCP23008 component (`datasheet `__, +Thanks to the amazing `Tasmota template `__, managed to build a fully working esphome configuration. This assumes you have a secret.yaml with ssid and password keys. .. code-block:: yaml @@ -39,7 +39,9 @@ managed to build a fully working esphome configuration. This assumes you have a id: button pin: number: GPIO4 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: True name: 'Switch feeder' on_press: diff --git a/cookbook/sonoff-basic-light-switch.rst b/cookbook/sonoff-basic-light-switch.rst index 5103ecb36..6fa6bab26 100644 --- a/cookbook/sonoff-basic-light-switch.rst +++ b/cookbook/sonoff-basic-light-switch.rst @@ -117,7 +117,9 @@ Now you have a pair of wires from the GPIO and 0V to your retractive switch lets - platform: gpio pin: number: GPIO14 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_1 on_press: diff --git a/cookbook/sonoff-dual-light-switch.rst b/cookbook/sonoff-dual-light-switch.rst index 506530a98..60a224058 100644 --- a/cookbook/sonoff-dual-light-switch.rst +++ b/cookbook/sonoff-dual-light-switch.rst @@ -97,7 +97,9 @@ The R1 version of the Dual controls the relays via the UART, so the code gets a - platform: gpio pin: number: GPIO4 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_1 on_press: @@ -107,7 +109,9 @@ The R1 version of the Dual controls the relays via the UART, so the code gets a - platform: gpio pin: number: GPIO14 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_2 on_press: @@ -196,7 +200,9 @@ It's basically the same as the :doc:`T2 ` - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button on_press: @@ -206,7 +212,9 @@ It's basically the same as the :doc:`T2 ` - platform: gpio pin: number: GPIO14 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button on_press: diff --git a/cookbook/sonoff-fishpond-pump.rst b/cookbook/sonoff-fishpond-pump.rst index 2be2e66b1..8091a8228 100644 --- a/cookbook/sonoff-fishpond-pump.rst +++ b/cookbook/sonoff-fishpond-pump.rst @@ -115,7 +115,9 @@ Here is the configuration with the basic operations outlined above. name: "esp_fishpond_gpio14" pin: number: 14 - mode: INPUT_PULLUP + mode: + input: true + pullup: true on_press: - switch.turn_off: esp_fishpond_pump diff --git a/cookbook/sonoff-t1-3.rst b/cookbook/sonoff-t1-3.rst index 371a54dd0..1306409f9 100644 --- a/cookbook/sonoff-t1-3.rst +++ b/cookbook/sonoff-t1-3.rst @@ -36,7 +36,9 @@ T1 - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_1 on_press: @@ -99,7 +101,9 @@ T2 - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_1 on_press: @@ -109,7 +113,9 @@ T2 - platform: gpio pin: number: GPIO9 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_2 on_press: @@ -170,7 +176,9 @@ T3 - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_1 on_press: @@ -180,7 +188,9 @@ T3 - platform: gpio pin: number: GPIO9 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_2 on_press: @@ -190,7 +200,9 @@ T3 - platform: gpio pin: number: GPIO10 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true id: button_3 on_press: @@ -241,4 +253,3 @@ See Also - :doc:`/cookbook/sonoff-light-switch` - :doc:`/guides/automations` - :doc:`/devices/sonoff_t1_uk_3gang_v1.1` - diff --git a/devices/sonoff_4ch.rst b/devices/sonoff_4ch.rst index 596c02df9..2db0f062d 100644 --- a/devices/sonoff_4ch.rst +++ b/devices/sonoff_4ch.rst @@ -243,25 +243,33 @@ of the basic functions. - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff 4CH Button 1" - platform: gpio pin: number: GPIO9 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff 4CH Button 2" - platform: gpio pin: number: GPIO10 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff 4CH Button 3" - platform: gpio pin: number: GPIO14 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff 4CH Button 4" - platform: status diff --git a/devices/sonoff_4ch.yaml b/devices/sonoff_4ch.yaml index 5c000e019..b76025555 100644 --- a/devices/sonoff_4ch.yaml +++ b/devices/sonoff_4ch.yaml @@ -17,7 +17,9 @@ binary_sensor: - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff 4CH Button 1" on_press: @@ -25,7 +27,9 @@ binary_sensor: - platform: gpio pin: number: GPIO9 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff 4CH Button 2" on_press: @@ -33,7 +37,9 @@ binary_sensor: - platform: gpio pin: number: GPIO10 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff 4CH Button 3" on_press: @@ -41,7 +47,9 @@ binary_sensor: - platform: gpio pin: number: GPIO14 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff 4CH Button 4" on_press: diff --git a/devices/sonoff_basic.rst b/devices/sonoff_basic.rst index a0d330536..f9d1c2bfe 100644 --- a/devices/sonoff_basic.rst +++ b/devices/sonoff_basic.rst @@ -70,7 +70,9 @@ exposes all of the basic functions. - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff Basic Button" on_press: diff --git a/devices/sonoff_s20.rst b/devices/sonoff_s20.rst index 8559f8f12..6ee9ff0fd 100644 --- a/devices/sonoff_s20.rst +++ b/devices/sonoff_s20.rst @@ -225,7 +225,9 @@ of the basic functions. - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff S20 Button" - platform: status diff --git a/devices/sonoff_s20.yaml b/devices/sonoff_s20.yaml index 0e4e00b50..64f886cad 100644 --- a/devices/sonoff_s20.yaml +++ b/devices/sonoff_s20.yaml @@ -18,7 +18,9 @@ binary_sensor: - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff S20 Button" on_press: diff --git a/devices/sonoff_t1_uk_3gang_v1.1.rst b/devices/sonoff_t1_uk_3gang_v1.1.rst index a81d1568d..5ddb0b08d 100644 --- a/devices/sonoff_t1_uk_3gang_v1.1.rst +++ b/devices/sonoff_t1_uk_3gang_v1.1.rst @@ -246,19 +246,25 @@ of the basic functions. - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T1 UK 3 Gang Touchpad 1" - platform: gpio pin: number: GPIO9 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T1 UK 3 Gang Touchpad 2" - platform: gpio pin: number: GPIO10 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T1 UK 3 Gang Touchpad 3" - platform: status diff --git a/devices/sonoff_t1_uk_3gang_v1.1.yaml b/devices/sonoff_t1_uk_3gang_v1.1.yaml index 1a1abc9b8..4bb865f58 100644 --- a/devices/sonoff_t1_uk_3gang_v1.1.yaml +++ b/devices/sonoff_t1_uk_3gang_v1.1.yaml @@ -24,7 +24,9 @@ binary_sensor: - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T1 UK 3 Gang Touchpad 1" on_press: @@ -32,7 +34,9 @@ binary_sensor: - platform: gpio pin: number: GPIO9 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T1 UK 3 Gang Touchpad 2" on_press: @@ -40,7 +44,9 @@ binary_sensor: - platform: gpio pin: number: GPIO10 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T1 UK 3 Gang Touchpad 3" on_press: diff --git a/devices/sonoff_t3_eu_3gang_v1.0.rst b/devices/sonoff_t3_eu_3gang_v1.0.rst index e870c5be7..f2e654da5 100644 --- a/devices/sonoff_t3_eu_3gang_v1.0.rst +++ b/devices/sonoff_t3_eu_3gang_v1.0.rst @@ -250,19 +250,25 @@ of the basic functions. - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T3 EU 3 Gang Touchpad 1" - platform: gpio pin: number: GPIO9 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T3 EU 3 Gang Touchpad 2" - platform: gpio pin: number: GPIO10 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T3 EU 3 Gang Touchpad 3" - platform: status diff --git a/devices/sonoff_t3_eu_3gang_v1.0.yaml b/devices/sonoff_t3_eu_3gang_v1.0.yaml index 0e0a6b190..eb31cc0b3 100644 --- a/devices/sonoff_t3_eu_3gang_v1.0.yaml +++ b/devices/sonoff_t3_eu_3gang_v1.0.yaml @@ -24,7 +24,9 @@ binary_sensor: - platform: gpio pin: number: GPIO0 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T3 EU 3 Gang Touchpad 1" on_press: @@ -32,7 +34,9 @@ binary_sensor: - platform: gpio pin: number: GPIO9 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T3 EU 3 Gang Touchpad 2" on_press: @@ -40,7 +44,9 @@ binary_sensor: - platform: gpio pin: number: GPIO10 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true name: "Sonoff T3 EU 3 Gang Touchpad 3" on_press: diff --git a/devices/teckin.yaml b/devices/teckin.yaml index b31395912..05d48bd4b 100644 --- a/devices/teckin.yaml +++ b/devices/teckin.yaml @@ -21,7 +21,9 @@ binary_sensor: name: "Teckin Button" pin: number: GPIO1 - mode: INPUT_PULLUP + mode: + input: true + pullup: true inverted: true on_press: - switch.toggle: relay diff --git a/guides/getting_started_command_line.rst b/guides/getting_started_command_line.rst index 5d836b884..525696804 100644 --- a/guides/getting_started_command_line.rst +++ b/guides/getting_started_command_line.rst @@ -19,7 +19,7 @@ Installing ESPHome is very easy. All you need to do is have `Python .. note:: Python 3.7 or above is required to install ESPHome 1.18.0 or above. - + .. code-block:: bash @@ -127,7 +127,9 @@ Sensor `. pin: number: 16 inverted: true - mode: INPUT_PULLUP + mode: + input: true + pullup: true This is an advanced feature of ESPHome. Almost all pins can optionally have a more complicated configuration schema with options for diff --git a/guides/getting_started_hassio.rst b/guides/getting_started_hassio.rst index 07bf3d071..00f8643ab 100644 --- a/guides/getting_started_hassio.rst +++ b/guides/getting_started_hassio.rst @@ -133,7 +133,9 @@ Sensor `. pin: number: 16 inverted: true - mode: INPUT_PULLUP + mode: + input: true + pullup: true This time when installing, you don’t need to have the device plugged in through USB again. The upload will happen wirelessly (:doc:`"over the air" `).