diff --git a/esphome/components/mcp3204/mcp3204.cpp b/esphome/components/mcp3204/mcp3204.cpp index 44044349a3..283df4ccdc 100644 --- a/esphome/components/mcp3204/mcp3204.cpp +++ b/esphome/components/mcp3204/mcp3204.cpp @@ -20,7 +20,7 @@ void MCP3204::dump_config() { } float MCP3204::read_data(uint8_t pin) { - uint8_t adc_primary_config = 0b00000110 & 0b00000111; + uint8_t adc_primary_config = 0b00000110 | (pin >> 2); uint8_t adc_secondary_config = pin << 6; this->enable(); this->transfer_byte(adc_primary_config); diff --git a/esphome/components/mcp3204/sensor/__init__.py b/esphome/components/mcp3204/sensor/__init__.py index 1d8701a91e..404880d405 100644 --- a/esphome/components/mcp3204/sensor/__init__.py +++ b/esphome/components/mcp3204/sensor/__init__.py @@ -17,7 +17,7 @@ CONFIG_SCHEMA = sensor.SENSOR_SCHEMA.extend( { cv.GenerateID(): cv.declare_id(MCP3204Sensor), cv.GenerateID(CONF_MCP3204_ID): cv.use_id(MCP3204), - cv.Required(CONF_NUMBER): cv.int_range(min=0, max=3), + cv.Required(CONF_NUMBER): cv.int_range(min=0, max=7), } ).extend(cv.polling_component_schema("60s"))