Fix pin/component switchup in SX1509 pin configuration (#2593)

This commit is contained in:
Oxan van Leeuwen 2021-10-21 19:55:19 +02:00 committed by Otto winter
parent ab34401421
commit ed0b34b2fe
No known key found for this signature in database
GPG key ID: 48ED2DDB96D7682C
3 changed files with 13 additions and 2 deletions

View file

@ -80,8 +80,8 @@ def validate_mode(value):
CONF_SX1509 = "sx1509"
SX1509_PIN_SCHEMA = cv.All(
{
cv.GenerateID(): cv.declare_id(SX1509Component),
cv.Required(CONF_SX1509): cv.use_id(SX1509GPIOPin),
cv.GenerateID(): cv.declare_id(SX1509GPIOPin),
cv.Required(CONF_SX1509): cv.use_id(SX1509Component),
cv.Required(CONF_NUMBER): cv.int_range(min=0, max=15),
cv.Optional(CONF_MODE, default={}): cv.All(
{

View file

@ -358,6 +358,7 @@ template<typename T> T clamp(const T val, const T min, const T max) {
return max;
return val;
}
template uint8_t clamp(uint8_t, uint8_t, uint8_t);
template float clamp(float, float, float);
template int clamp(int, int, int);

View file

@ -59,6 +59,10 @@ tuya:
pipsolar:
id: inverter0
sx1509:
- id: sx1509_hub
address: 0x3E
sensor:
- platform: homeassistant
entity_id: sensor.hello_world
@ -209,6 +213,7 @@ sensor:
- or:
- throttle: "20min"
- delta: 0.02
#
# platform sensor.apds9960 requires component apds9960
#
@ -308,6 +313,11 @@ binary_sensor:
y_max: 212
on_state:
- lambda: 'ESP_LOGI("main", "key0: %s", (x ? "touch" : "release"));'
- platform: gpio
name: GPIO SX1509 test
pin:
sx1509: sx1509_hub
number: 3
climate:
- platform: tuya