Conforming to CLANG standards

This commit is contained in:
markodraca 2024-09-12 18:32:18 +02:00
parent b063fa17f8
commit 543a4ba7a4
3 changed files with 11 additions and 11 deletions

View file

@ -8,15 +8,15 @@ namespace esphome {
namespace mcp3204 {
class MCP3204 : public Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST,
spi::CLOCK_POLARITY_LOW,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST,
spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING,
spi::DATA_RATE_1MHZ> {
public:
MCP3204() = default;
void set_reference_voltage(float reference_voltage)
{
void set_reference_voltage(float reference_voltage)
{
this->reference_voltage_ = reference_voltage;
}

View file

@ -20,7 +20,7 @@ CONFIG_SCHEMA = (
{
cv.GenerateID(CONF_MCP3204_ID): cv.use_id(MCP3204),
cv.Required(CONF_NUMBER): cv.int_range(min=0, max=7),
cv.Optional(CONF_DIFF_MODE, default = 'false'): cv.boolean,
cv.Optional(CONF_DIFF_MODE, default="false"): cv.boolean,
}
)
.extend(cv.polling_component_schema("60s"))

View file

@ -17,13 +17,13 @@ void MCP3204Sensor::dump_config() {
ESP_LOGCONFIG(TAG, " DIFFERENTIAL MODE: %u", this->diffmode_);
LOG_UPDATE_INTERVAL(this);
}
float MCP3204Sensor::sample()
{
return this->parent_->read_data(this->pin_, this->diffmode_);
float MCP3204Sensor::sample()
{
return this->parent_->read_data(this->pin_, this->diffmode_);
}
void MCP3204Sensor::update()
{
this->publish_state(this->sample());
void MCP3204Sensor::update()
{
this->publish_state(this->sample());
}
} // namespace mcp3204