mirror of
https://github.com/esphome/esphome.git
synced 2024-12-25 06:54:52 +01:00
DALY Modbus BMS: linting
This commit is contained in:
parent
a93a48879a
commit
a9343d35f1
2 changed files with 11 additions and 5 deletions
|
@ -19,9 +19,15 @@ CONFIG_SCHEMA = cv.All(
|
|||
cv.Schema(
|
||||
{
|
||||
cv.GenerateID(CONF_DALY_HKMS_BMS_ID): cv.use_id(DalyHkmsBmsComponent),
|
||||
cv.Optional(CONF_CHARGING_MOS_ENABLED): binary_sensor.binary_sensor_schema(),
|
||||
cv.Optional(CONF_DISCHARGING_MOS_ENABLED): binary_sensor.binary_sensor_schema(),
|
||||
cv.Optional(CONF_PRECHARGING_MOS_ENABLED): binary_sensor.binary_sensor_schema(),
|
||||
cv.Optional(
|
||||
CONF_CHARGING_MOS_ENABLED
|
||||
): binary_sensor.binary_sensor_schema(),
|
||||
cv.Optional(
|
||||
CONF_DISCHARGING_MOS_ENABLED
|
||||
): binary_sensor.binary_sensor_schema(),
|
||||
cv.Optional(
|
||||
CONF_PRECHARGING_MOS_ENABLED
|
||||
): binary_sensor.binary_sensor_schema(),
|
||||
cv.Optional(CONF_BALANCING_ACTIVE): binary_sensor.binary_sensor_schema(),
|
||||
}
|
||||
).extend(cv.COMPONENT_SCHEMA)
|
||||
|
|
|
@ -30,10 +30,10 @@ class DalyHkmsBmsComponent : public PollingComponent, public modbus::ModbusDevic
|
|||
void set_daly_address(uint8_t address);
|
||||
|
||||
#ifdef USE_SENSOR
|
||||
void set_cell_voltage_sensor(size_t cell, sensor::Sensor *sensor) {
|
||||
void set_cell_voltage_sensor(size_t cell, sensor::Sensor *sensor) {
|
||||
if (cell > this->cell_voltage_sensors_max_)
|
||||
this->cell_voltage_sensors_max_ = cell;
|
||||
this->cell_voltage_sensors_[cell - 1] = sensor;
|
||||
this->cell_voltage_sensors_[cell - 1] = sensor;
|
||||
};
|
||||
|
||||
SUB_SENSOR(voltage)
|
||||
|
|
Loading…
Reference in a new issue