Browse Source

Suppress 'GPIO<x> is a Strapping PIN and should be avoided' warnings

release/2023.4.0
Maurice Makaay 1 year ago
parent
commit
7c427c4c0c
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      components/xiaomi_bslamp2/__init__.py

+ 10
- 0
components/xiaomi_bslamp2/__init__.py View File

@ -4,6 +4,7 @@ from esphome import pins
from esphome.components.ledc.output import LEDCOutput
from esphome.components.gpio.output import GPIOBinaryOutput
from esphome.components.i2c import I2CBus, I2CDevice
from esphome.components.esp32 import gpio_esp32
from esphome.const import (
CONF_LIGHT, CONF_RED, CONF_GREEN, CONF_BLUE, CONF_WHITE,
CONF_I2C, CONF_ADDRESS, CONF_TRIGGER_PIN, CONF_ID
@ -100,6 +101,15 @@ async def make_front_panel_hal(config):
cg.add(fp_hal.set_i2c_bus(fp_i2c_var))
cg.add(fp_hal.set_i2c_address(config[CONF_FRONT_PANEL][CONF_ADDRESS]))
# Clear the configuration of strapping pins in ESPHome, to suppress pin
# usage warnings that often confuse users of this firmware (when there
# are problems, these often pop up as "is this the issue?").
# The hardware on the lamp is as-is, and warnings about pins that might
# better not be used are futile.
gpio_esp32._ESP32_STRAPPING_PINS = {}
async def to_code(config):
await make_light_hal(config)
await make_front_panel_hal(config)

Loading…
Cancel
Save