mirror of
https://github.com/esphome/esphome.git
synced 2024-12-04 13:44:40 +01:00
Fixed linting errors
This commit is contained in:
parent
0e000a3164
commit
c73e5efcff
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
#define TARGET_COUNT 9
|
static const uint8_t TARGET_COUNT = 9;
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace dfrobot_sen0395 {
|
namespace dfrobot_sen0395 {
|
||||||
|
@ -2,8 +2,8 @@ import esphome.codegen as cg
|
|||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import sensor
|
from esphome.components import sensor
|
||||||
from esphome.components.sensor import (
|
from esphome.components.sensor import (
|
||||||
validate_unit_of_measurement,
|
|
||||||
validate_device_class,
|
validate_device_class,
|
||||||
|
validate_unit_of_measurement,
|
||||||
)
|
)
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
@ -13,11 +13,12 @@ from esphome.const import (
|
|||||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import CONF_DFROBOT_SEN0395_ID, DfrobotSen0395Component
|
from . import CONF_DFROBOT_SEN0395_ID, DfrobotSen0395Component
|
||||||
|
|
||||||
DEPENDENCIES = ["dfrobot_sen0395"]
|
DEPENDENCIES = ["dfrobot_sen0395"]
|
||||||
|
|
||||||
CONF_TARGET_NUMBER = "target"
|
CONF_TARGET = "target"
|
||||||
|
|
||||||
_SENSOR_SCHEMA = (
|
_SENSOR_SCHEMA = (
|
||||||
sensor.sensor_schema(
|
sensor.sensor_schema(
|
||||||
@ -28,7 +29,7 @@ _SENSOR_SCHEMA = (
|
|||||||
.extend(
|
.extend(
|
||||||
{
|
{
|
||||||
cv.GenerateID(CONF_DFROBOT_SEN0395_ID): cv.use_id(DfrobotSen0395Component),
|
cv.GenerateID(CONF_DFROBOT_SEN0395_ID): cv.use_id(DfrobotSen0395Component),
|
||||||
cv.Required(CONF_TARGET_NUMBER): cv.int_range(min=1, max=9),
|
cv.Required(CONF_TARGET): cv.int_range(min=1, max=9),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.extend(cv.COMPONENT_SCHEMA)
|
.extend(cv.COMPONENT_SCHEMA)
|
||||||
@ -57,13 +58,7 @@ async def to_code(config):
|
|||||||
|
|
||||||
if config[CONF_TYPE] == "distance":
|
if config[CONF_TYPE] == "distance":
|
||||||
cg.add(
|
cg.add(
|
||||||
parent.set_detected_target_distance_sensor(
|
parent.set_detected_target_distance_sensor(config[CONF_TARGET], binary_sens)
|
||||||
config[CONF_TARGET_NUMBER], binary_sens
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
elif config[CONF_TYPE] == "SNR":
|
elif config[CONF_TYPE] == "SNR":
|
||||||
cg.add(
|
cg.add(parent.set_detected_target_snr_sensor(config[CONF_TARGET], binary_sens))
|
||||||
parent.set_detected_target_snr_sensor(
|
|
||||||
config[CONF_TARGET_NUMBER], binary_sens
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user