get rid of most AUTOLOADs in optolink component

This commit is contained in:
j0ta29 2023-10-25 13:42:10 +00:00
parent a14acb4a16
commit a8ed21ae74
9 changed files with 25 additions and 5 deletions

View file

@ -17,8 +17,8 @@ from esphome.const import (
from esphome.core import CORE from esphome.core import CORE
CODEOWNERS = ["@j0ta29"] CODEOWNERS = ["@j0ta29"]
DEPENDENCIES = [] DEPENDENCIES = ["text_sensor"]
AUTO_LOAD = ["sensor", "binary_sensor", "text_sensor", "number", "select", "switch"] AUTO_LOAD = []
MULTI_CONF = False MULTI_CONF = False
CONF_DEVICE_INFO = "device_info" CONF_DEVICE_INFO = "device_info"

View file

@ -3,6 +3,10 @@ from esphome.components import binary_sensor
from esphome.const import CONF_ADDRESS, CONF_ID from esphome.const import CONF_ADDRESS, CONF_ID
from .. import SENSOR_BASE_SCHEMA, optolink_ns, CONF_OPTOLINK_ID from .. import SENSOR_BASE_SCHEMA, optolink_ns, CONF_OPTOLINK_ID
DEPENDENCIES = ["optolink"]
CODEOWNERS = ["@j0ta29"]
OptolinkBinarySensor = optolink_ns.class_( OptolinkBinarySensor = optolink_ns.class_(
"OptolinkBinarySensor", binary_sensor.BinarySensor, cg.PollingComponent "OptolinkBinarySensor", binary_sensor.BinarySensor, cg.PollingComponent
) )

View file

@ -12,6 +12,10 @@ from esphome.const import (
) )
from .. import optolink_ns, CONF_OPTOLINK_ID, SENSOR_BASE_SCHEMA from .. import optolink_ns, CONF_OPTOLINK_ID, SENSOR_BASE_SCHEMA
DEPENDENCIES = ["optolink"]
CODEOWNERS = ["@j0ta29"]
OptolinkNumber = optolink_ns.class_( OptolinkNumber = optolink_ns.class_(
"OptolinkNumber", number.Number, cg.PollingComponent "OptolinkNumber", number.Number, cg.PollingComponent
) )

View file

@ -1,6 +1,7 @@
#ifdef USE_ARDUINO #ifdef USE_ARDUINO
#include "esphome/core/defines.h" #include "esphome/core/defines.h"
#include "esphome/core/log.h"
#include "optolink.h" #include "optolink.h"
#include "VitoWiFi.h" #include "VitoWiFi.h"

View file

@ -3,8 +3,6 @@
#ifdef USE_ARDUINO #ifdef USE_ARDUINO
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/binary_sensor/binary_sensor.h"
#include "esphome/components/text_sensor/text_sensor.h" #include "esphome/components/text_sensor/text_sensor.h"
#include "VitoWiFi.h" #include "VitoWiFi.h"

View file

@ -11,6 +11,10 @@ from esphome.const import (
) )
from .. import optolink_ns, CONF_OPTOLINK_ID, SENSOR_BASE_SCHEMA from .. import optolink_ns, CONF_OPTOLINK_ID, SENSOR_BASE_SCHEMA
DEPENDENCIES = ["optolink"]
CODEOWNERS = ["@j0ta29"]
OptolinkSelect = optolink_ns.class_( OptolinkSelect = optolink_ns.class_(
"OptolinkSelect", select.Select, cg.PollingComponent "OptolinkSelect", select.Select, cg.PollingComponent
) )

View file

@ -9,6 +9,10 @@ from esphome.const import (
) )
from .. import CONF_OPTOLINK_ID, SENSOR_BASE_SCHEMA, optolink_ns from .. import CONF_OPTOLINK_ID, SENSOR_BASE_SCHEMA, optolink_ns
DEPENDENCIES = ["optolink"]
CODEOWNERS = ["@j0ta29"]
OptolinkSensor = optolink_ns.class_( OptolinkSensor = optolink_ns.class_(
"OptolinkSensor", sensor.Sensor, cg.PollingComponent "OptolinkSensor", sensor.Sensor, cg.PollingComponent
) )

View file

@ -5,6 +5,10 @@ from esphome.components import switch
from esphome.const import CONF_ADDRESS, CONF_ID, CONF_UPDATE_INTERVAL from esphome.const import CONF_ADDRESS, CONF_ID, CONF_UPDATE_INTERVAL
from .. import OptolinkComponent, optolink_ns from .. import OptolinkComponent, optolink_ns
DEPENDENCIES = ["optolink"]
CODEOWNERS = ["@j0ta29"]
OptolinkSwitch = optolink_ns.class_( OptolinkSwitch = optolink_ns.class_(
"OptolinkSwitch", switch.Switch, cg.PollingComponent "OptolinkSwitch", switch.Switch, cg.PollingComponent
) )

View file

@ -11,7 +11,8 @@ from esphome.const import (
) )
from .. import optolink_ns, CONF_OPTOLINK_ID, SENSOR_BASE_SCHEMA from .. import optolink_ns, CONF_OPTOLINK_ID, SENSOR_BASE_SCHEMA
DEPENDENCIES = ["api"] DEPENDENCIES = ["optolink", "api"]
CODEOWNERS = ["@j0ta29"]
TextSensorMode = optolink_ns.enum("TextSensorMode") TextSensorMode = optolink_ns.enum("TextSensorMode")
MODE = { MODE = {