mirror of
https://github.com/esphome/esphome.git
synced 2025-01-03 11:21:43 +01:00
[code-quality] Organise base entities imports (#7208)
This commit is contained in:
parent
9b0c2234d8
commit
c348efa401
17 changed files with 119 additions and 123 deletions
|
@ -1,10 +1,8 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.cpp_generator import MockObjClass
|
|
||||||
from esphome.cpp_helpers import setup_entity
|
|
||||||
from esphome import automation, core
|
from esphome import automation, core
|
||||||
from esphome.automation import Condition, maybe_simple_id
|
from esphome.automation import Condition, maybe_simple_id
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DELAY,
|
CONF_DELAY,
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
|
@ -16,6 +14,7 @@ from esphome.const import (
|
||||||
CONF_INVERTED,
|
CONF_INVERTED,
|
||||||
CONF_MAX_LENGTH,
|
CONF_MAX_LENGTH,
|
||||||
CONF_MIN_LENGTH,
|
CONF_MIN_LENGTH,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_CLICK,
|
CONF_ON_CLICK,
|
||||||
CONF_ON_DOUBLE_CLICK,
|
CONF_ON_DOUBLE_CLICK,
|
||||||
CONF_ON_MULTI_CLICK,
|
CONF_ON_MULTI_CLICK,
|
||||||
|
@ -26,7 +25,6 @@ from esphome.const import (
|
||||||
CONF_STATE,
|
CONF_STATE,
|
||||||
CONF_TIMING,
|
CONF_TIMING,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_WEB_SERVER_ID,
|
||||||
DEVICE_CLASS_BATTERY,
|
DEVICE_CLASS_BATTERY,
|
||||||
DEVICE_CLASS_BATTERY_CHARGING,
|
DEVICE_CLASS_BATTERY_CHARGING,
|
||||||
|
@ -59,6 +57,8 @@ from esphome.const import (
|
||||||
DEVICE_CLASS_WINDOW,
|
DEVICE_CLASS_WINDOW,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
|
from esphome.cpp_generator import MockObjClass
|
||||||
|
from esphome.cpp_helpers import setup_entity
|
||||||
from esphome.util import Registry
|
from esphome.util import Registry
|
||||||
|
|
||||||
CODEOWNERS = ["@esphome/core"]
|
CODEOWNERS = ["@esphome/core"]
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.automation import maybe_simple_id
|
from esphome.automation import maybe_simple_id
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
CONF_ENTITY_CATEGORY,
|
CONF_ENTITY_CATEGORY,
|
||||||
CONF_ICON,
|
CONF_ICON,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_PRESS,
|
CONF_ON_PRESS,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_WEB_SERVER_ID,
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
DEVICE_CLASS_IDENTIFY,
|
DEVICE_CLASS_IDENTIFY,
|
||||||
|
@ -18,8 +18,8 @@ from esphome.const import (
|
||||||
DEVICE_CLASS_UPDATE,
|
DEVICE_CLASS_UPDATE,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
|
||||||
from esphome.cpp_generator import MockObjClass
|
from esphome.cpp_generator import MockObjClass
|
||||||
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
||||||
CODEOWNERS = ["@esphome/core"]
|
CODEOWNERS = ["@esphome/core"]
|
||||||
IS_PLATFORM_COMPONENT = True
|
IS_PLATFORM_COMPONENT = True
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.cpp_helpers import setup_entity
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ACTION_STATE_TOPIC,
|
CONF_ACTION_STATE_TOPIC,
|
||||||
CONF_AWAY,
|
CONF_AWAY,
|
||||||
|
@ -21,6 +20,7 @@ from esphome.const import (
|
||||||
CONF_MODE,
|
CONF_MODE,
|
||||||
CONF_MODE_COMMAND_TOPIC,
|
CONF_MODE_COMMAND_TOPIC,
|
||||||
CONF_MODE_STATE_TOPIC,
|
CONF_MODE_STATE_TOPIC,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_CONTROL,
|
CONF_ON_CONTROL,
|
||||||
CONF_ON_STATE,
|
CONF_ON_STATE,
|
||||||
CONF_PRESET,
|
CONF_PRESET,
|
||||||
|
@ -33,20 +33,20 @@ from esphome.const import (
|
||||||
CONF_TARGET_HUMIDITY_STATE_TOPIC,
|
CONF_TARGET_HUMIDITY_STATE_TOPIC,
|
||||||
CONF_TARGET_TEMPERATURE,
|
CONF_TARGET_TEMPERATURE,
|
||||||
CONF_TARGET_TEMPERATURE_COMMAND_TOPIC,
|
CONF_TARGET_TEMPERATURE_COMMAND_TOPIC,
|
||||||
CONF_TARGET_TEMPERATURE_STATE_TOPIC,
|
|
||||||
CONF_TARGET_TEMPERATURE_HIGH,
|
CONF_TARGET_TEMPERATURE_HIGH,
|
||||||
CONF_TARGET_TEMPERATURE_HIGH_COMMAND_TOPIC,
|
CONF_TARGET_TEMPERATURE_HIGH_COMMAND_TOPIC,
|
||||||
CONF_TARGET_TEMPERATURE_HIGH_STATE_TOPIC,
|
CONF_TARGET_TEMPERATURE_HIGH_STATE_TOPIC,
|
||||||
CONF_TARGET_TEMPERATURE_LOW,
|
CONF_TARGET_TEMPERATURE_LOW,
|
||||||
CONF_TARGET_TEMPERATURE_LOW_COMMAND_TOPIC,
|
CONF_TARGET_TEMPERATURE_LOW_COMMAND_TOPIC,
|
||||||
CONF_TARGET_TEMPERATURE_LOW_STATE_TOPIC,
|
CONF_TARGET_TEMPERATURE_LOW_STATE_TOPIC,
|
||||||
|
CONF_TARGET_TEMPERATURE_STATE_TOPIC,
|
||||||
CONF_TEMPERATURE_STEP,
|
CONF_TEMPERATURE_STEP,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_VISUAL,
|
CONF_VISUAL,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_WEB_SERVER_ID,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
||||||
IS_PLATFORM_COMPONENT = True
|
IS_PLATFORM_COMPONENT = True
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.automation import maybe_simple_id, Condition
|
from esphome.automation import Condition, maybe_simple_id
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ID,
|
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
CONF_STATE,
|
CONF_ID,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_OPEN,
|
CONF_ON_OPEN,
|
||||||
CONF_POSITION,
|
CONF_POSITION,
|
||||||
CONF_POSITION_COMMAND_TOPIC,
|
CONF_POSITION_COMMAND_TOPIC,
|
||||||
CONF_POSITION_STATE_TOPIC,
|
CONF_POSITION_STATE_TOPIC,
|
||||||
|
CONF_STATE,
|
||||||
|
CONF_STOP,
|
||||||
CONF_TILT,
|
CONF_TILT,
|
||||||
CONF_TILT_COMMAND_TOPIC,
|
CONF_TILT_COMMAND_TOPIC,
|
||||||
CONF_TILT_STATE_TOPIC,
|
CONF_TILT_STATE_TOPIC,
|
||||||
CONF_STOP,
|
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
|
CONF_WEB_SERVER_ID,
|
||||||
DEVICE_CLASS_AWNING,
|
DEVICE_CLASS_AWNING,
|
||||||
DEVICE_CLASS_BLIND,
|
DEVICE_CLASS_BLIND,
|
||||||
DEVICE_CLASS_CURTAIN,
|
DEVICE_CLASS_CURTAIN,
|
||||||
|
|
|
@ -1,32 +1,30 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.components import mqtt, web_server, time
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import mqtt, time, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
CONF_DATE,
|
||||||
|
CONF_DATETIME,
|
||||||
|
CONF_DAY,
|
||||||
|
CONF_HOUR,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
CONF_MINUTE,
|
||||||
|
CONF_MONTH,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_TIME,
|
CONF_ON_TIME,
|
||||||
CONF_ON_VALUE,
|
CONF_ON_VALUE,
|
||||||
|
CONF_SECOND,
|
||||||
|
CONF_TIME,
|
||||||
CONF_TIME_ID,
|
CONF_TIME_ID,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_TYPE,
|
CONF_TYPE,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_WEB_SERVER_ID,
|
||||||
CONF_DATE,
|
|
||||||
CONF_DATETIME,
|
|
||||||
CONF_TIME,
|
|
||||||
CONF_YEAR,
|
CONF_YEAR,
|
||||||
CONF_MONTH,
|
|
||||||
CONF_DAY,
|
|
||||||
CONF_SECOND,
|
|
||||||
CONF_HOUR,
|
|
||||||
CONF_MINUTE,
|
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_generator import MockObjClass
|
from esphome.cpp_generator import MockObjClass
|
||||||
from esphome.cpp_helpers import setup_entity
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
||||||
|
|
||||||
CODEOWNERS = ["@rfdarter", "@jesserockz"]
|
CODEOWNERS = ["@rfdarter", "@jesserockz"]
|
||||||
DEPENDENCIES = ["time"]
|
DEPENDENCIES = ["time"]
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt
|
from esphome.components import mqtt
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
CONF_ENTITY_CATEGORY,
|
CONF_ENTITY_CATEGORY,
|
||||||
|
CONF_EVENT_TYPE,
|
||||||
CONF_ICON,
|
CONF_ICON,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_EVENT,
|
CONF_ON_EVENT,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_EVENT_TYPE,
|
|
||||||
DEVICE_CLASS_BUTTON,
|
DEVICE_CLASS_BUTTON,
|
||||||
DEVICE_CLASS_DOORBELL,
|
DEVICE_CLASS_DOORBELL,
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
DEVICE_CLASS_MOTION,
|
DEVICE_CLASS_MOTION,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
|
||||||
from esphome.cpp_generator import MockObjClass
|
from esphome.cpp_generator import MockObjClass
|
||||||
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
||||||
CODEOWNERS = ["@nohat"]
|
CODEOWNERS = ["@nohat"]
|
||||||
IS_PLATFORM_COMPONENT = True
|
IS_PLATFORM_COMPONENT = True
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.automation import maybe_simple_id
|
from esphome.automation import maybe_simple_id
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
CONF_DIRECTION,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_MQTT_ID,
|
CONF_MQTT_ID,
|
||||||
CONF_WEB_SERVER_ID,
|
|
||||||
CONF_OSCILLATING,
|
|
||||||
CONF_OSCILLATION_COMMAND_TOPIC,
|
|
||||||
CONF_OSCILLATION_STATE_TOPIC,
|
|
||||||
CONF_SPEED,
|
|
||||||
CONF_SPEED_LEVEL_COMMAND_TOPIC,
|
|
||||||
CONF_SPEED_LEVEL_STATE_TOPIC,
|
|
||||||
CONF_SPEED_COMMAND_TOPIC,
|
|
||||||
CONF_SPEED_STATE_TOPIC,
|
|
||||||
CONF_OFF_SPEED_CYCLE,
|
CONF_OFF_SPEED_CYCLE,
|
||||||
CONF_ON_DIRECTION_SET,
|
CONF_ON_DIRECTION_SET,
|
||||||
CONF_ON_OSCILLATING_SET,
|
CONF_ON_OSCILLATING_SET,
|
||||||
|
CONF_ON_PRESET_SET,
|
||||||
CONF_ON_SPEED_SET,
|
CONF_ON_SPEED_SET,
|
||||||
CONF_ON_STATE,
|
CONF_ON_STATE,
|
||||||
CONF_ON_TURN_OFF,
|
CONF_ON_TURN_OFF,
|
||||||
CONF_ON_TURN_ON,
|
CONF_ON_TURN_ON,
|
||||||
CONF_ON_PRESET_SET,
|
CONF_OSCILLATING,
|
||||||
CONF_TRIGGER_ID,
|
CONF_OSCILLATION_COMMAND_TOPIC,
|
||||||
CONF_DIRECTION,
|
CONF_OSCILLATION_STATE_TOPIC,
|
||||||
CONF_RESTORE_MODE,
|
CONF_RESTORE_MODE,
|
||||||
|
CONF_SPEED,
|
||||||
|
CONF_SPEED_COMMAND_TOPIC,
|
||||||
|
CONF_SPEED_LEVEL_COMMAND_TOPIC,
|
||||||
|
CONF_SPEED_LEVEL_STATE_TOPIC,
|
||||||
|
CONF_SPEED_STATE_TOPIC,
|
||||||
|
CONF_TRIGGER_ID,
|
||||||
|
CONF_WEB_SERVER_ID,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
import esphome.automation as auto
|
import esphome.automation as auto
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, power_supply, web_server
|
from esphome.components import mqtt, power_supply, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
CONF_COLD_WHITE_COLOR_TEMPERATURE,
|
||||||
CONF_COLOR_CORRECT,
|
CONF_COLOR_CORRECT,
|
||||||
CONF_DEFAULT_TRANSITION_LENGTH,
|
CONF_DEFAULT_TRANSITION_LENGTH,
|
||||||
CONF_EFFECTS,
|
CONF_EFFECTS,
|
||||||
|
@ -10,36 +11,36 @@ from esphome.const import (
|
||||||
CONF_GAMMA_CORRECT,
|
CONF_GAMMA_CORRECT,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_MQTT_ID,
|
CONF_MQTT_ID,
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_ON_STATE,
|
||||||
CONF_POWER_SUPPLY,
|
|
||||||
CONF_RESTORE_MODE,
|
|
||||||
CONF_ON_TURN_OFF,
|
CONF_ON_TURN_OFF,
|
||||||
CONF_ON_TURN_ON,
|
CONF_ON_TURN_ON,
|
||||||
CONF_ON_STATE,
|
CONF_POWER_SUPPLY,
|
||||||
|
CONF_RESTORE_MODE,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_COLD_WHITE_COLOR_TEMPERATURE,
|
|
||||||
CONF_WARM_WHITE_COLOR_TEMPERATURE,
|
CONF_WARM_WHITE_COLOR_TEMPERATURE,
|
||||||
|
CONF_WEB_SERVER_ID,
|
||||||
)
|
)
|
||||||
from esphome.core import coroutine_with_priority
|
from esphome.core import coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
||||||
from .automation import light_control_to_code # noqa
|
from .automation import light_control_to_code # noqa
|
||||||
from .effects import (
|
from .effects import (
|
||||||
validate_effects,
|
ADDRESSABLE_EFFECTS,
|
||||||
BINARY_EFFECTS,
|
BINARY_EFFECTS,
|
||||||
|
EFFECTS_REGISTRY,
|
||||||
MONOCHROMATIC_EFFECTS,
|
MONOCHROMATIC_EFFECTS,
|
||||||
RGB_EFFECTS,
|
RGB_EFFECTS,
|
||||||
ADDRESSABLE_EFFECTS,
|
validate_effects,
|
||||||
EFFECTS_REGISTRY,
|
|
||||||
)
|
)
|
||||||
from .types import ( # noqa
|
from .types import ( # noqa
|
||||||
LightState,
|
|
||||||
AddressableLightState,
|
|
||||||
light_ns,
|
|
||||||
LightOutput,
|
|
||||||
AddressableLight,
|
AddressableLight,
|
||||||
LightTurnOnTrigger,
|
AddressableLightState,
|
||||||
LightTurnOffTrigger,
|
LightOutput,
|
||||||
|
LightState,
|
||||||
LightStateTrigger,
|
LightStateTrigger,
|
||||||
|
LightTurnOffTrigger,
|
||||||
|
LightTurnOnTrigger,
|
||||||
|
light_ns,
|
||||||
)
|
)
|
||||||
|
|
||||||
CODEOWNERS = ["@esphome/core"]
|
CODEOWNERS = ["@esphome/core"]
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.automation import Condition, maybe_simple_id
|
from esphome.automation import Condition, maybe_simple_id
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_LOCK,
|
CONF_ON_LOCK,
|
||||||
CONF_ON_UNLOCK,
|
CONF_ON_UNLOCK,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_WEB_SERVER_ID,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
|
|
|
@ -1,20 +1,18 @@
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
import esphome.config_validation as cv
|
|
||||||
import esphome.codegen as cg
|
|
||||||
|
|
||||||
from esphome.automation import maybe_simple_id
|
from esphome.automation import maybe_simple_id
|
||||||
|
import esphome.codegen as cg
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
CONF_ON_IDLE,
|
||||||
CONF_ON_STATE,
|
CONF_ON_STATE,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_VOLUME,
|
CONF_VOLUME,
|
||||||
CONF_ON_IDLE,
|
|
||||||
)
|
)
|
||||||
from esphome.core import CORE
|
from esphome.core import CORE
|
||||||
from esphome.coroutine import coroutine_with_priority
|
from esphome.coroutine import coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
||||||
|
|
||||||
CODEOWNERS = ["@jesserockz"]
|
CODEOWNERS = ["@jesserockz"]
|
||||||
|
|
||||||
IS_PLATFORM_COMPONENT = True
|
IS_PLATFORM_COMPONENT = True
|
||||||
|
|
|
@ -1,24 +1,23 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.components import mqtt
|
import esphome.codegen as cg
|
||||||
from esphome.components import web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ABOVE,
|
CONF_ABOVE,
|
||||||
CONF_BELOW,
|
CONF_BELOW,
|
||||||
|
CONF_CYCLE,
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
CONF_ENTITY_CATEGORY,
|
CONF_ENTITY_CATEGORY,
|
||||||
CONF_ID,
|
|
||||||
CONF_ICON,
|
CONF_ICON,
|
||||||
|
CONF_ID,
|
||||||
CONF_MODE,
|
CONF_MODE,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_VALUE,
|
CONF_ON_VALUE,
|
||||||
CONF_ON_VALUE_RANGE,
|
CONF_ON_VALUE_RANGE,
|
||||||
|
CONF_OPERATION,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_UNIT_OF_MEASUREMENT,
|
CONF_UNIT_OF_MEASUREMENT,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_VALUE,
|
CONF_VALUE,
|
||||||
CONF_OPERATION,
|
|
||||||
CONF_CYCLE,
|
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_WEB_SERVER_ID,
|
||||||
DEVICE_CLASS_APPARENT_POWER,
|
DEVICE_CLASS_APPARENT_POWER,
|
||||||
DEVICE_CLASS_AQI,
|
DEVICE_CLASS_AQI,
|
||||||
|
@ -72,8 +71,8 @@ from esphome.const import (
|
||||||
DEVICE_CLASS_WIND_SPEED,
|
DEVICE_CLASS_WIND_SPEED,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
|
||||||
from esphome.cpp_generator import MockObjClass
|
from esphome.cpp_generator import MockObjClass
|
||||||
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
||||||
CODEOWNERS = ["@esphome/core"]
|
CODEOWNERS = ["@esphome/core"]
|
||||||
DEVICE_CLASSES = [
|
DEVICE_CLASSES = [
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
CONF_CYCLE,
|
||||||
CONF_ENTITY_CATEGORY,
|
CONF_ENTITY_CATEGORY,
|
||||||
CONF_ICON,
|
CONF_ICON,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
CONF_INDEX,
|
||||||
|
CONF_MODE,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_VALUE,
|
CONF_ON_VALUE,
|
||||||
|
CONF_OPERATION,
|
||||||
CONF_OPTION,
|
CONF_OPTION,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_WEB_SERVER_ID,
|
||||||
CONF_CYCLE,
|
|
||||||
CONF_MODE,
|
|
||||||
CONF_OPERATION,
|
|
||||||
CONF_INDEX,
|
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_generator import MockObjClass
|
from esphome.cpp_generator import MockObjClass
|
||||||
|
|
|
@ -1,22 +1,27 @@
|
||||||
import math
|
import math
|
||||||
|
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
|
||||||
CONF_ABOVE,
|
CONF_ABOVE,
|
||||||
CONF_ACCURACY_DECIMALS,
|
CONF_ACCURACY_DECIMALS,
|
||||||
CONF_ALPHA,
|
CONF_ALPHA,
|
||||||
CONF_BELOW,
|
CONF_BELOW,
|
||||||
|
CONF_DEVICE_CLASS,
|
||||||
CONF_ENTITY_CATEGORY,
|
CONF_ENTITY_CATEGORY,
|
||||||
CONF_EXPIRE_AFTER,
|
CONF_EXPIRE_AFTER,
|
||||||
CONF_FILTERS,
|
CONF_FILTERS,
|
||||||
|
CONF_FORCE_UPDATE,
|
||||||
CONF_FROM,
|
CONF_FROM,
|
||||||
CONF_ICON,
|
CONF_ICON,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_IGNORE_OUT_OF_RANGE,
|
CONF_IGNORE_OUT_OF_RANGE,
|
||||||
|
CONF_MAX_VALUE,
|
||||||
|
CONF_METHOD,
|
||||||
|
CONF_MIN_VALUE,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_MULTIPLE,
|
CONF_MULTIPLE,
|
||||||
CONF_ON_RAW_VALUE,
|
CONF_ON_RAW_VALUE,
|
||||||
CONF_ON_VALUE,
|
CONF_ON_VALUE,
|
||||||
|
@ -30,14 +35,9 @@ from esphome.const import (
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_TYPE,
|
CONF_TYPE,
|
||||||
CONF_UNIT_OF_MEASUREMENT,
|
CONF_UNIT_OF_MEASUREMENT,
|
||||||
CONF_WINDOW_SIZE,
|
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
|
||||||
CONF_FORCE_UPDATE,
|
|
||||||
CONF_VALUE,
|
CONF_VALUE,
|
||||||
CONF_MIN_VALUE,
|
CONF_WEB_SERVER_ID,
|
||||||
CONF_MAX_VALUE,
|
CONF_WINDOW_SIZE,
|
||||||
CONF_METHOD,
|
|
||||||
DEVICE_CLASS_APPARENT_POWER,
|
DEVICE_CLASS_APPARENT_POWER,
|
||||||
DEVICE_CLASS_AQI,
|
DEVICE_CLASS_AQI,
|
||||||
DEVICE_CLASS_ATMOSPHERIC_PRESSURE,
|
DEVICE_CLASS_ATMOSPHERIC_PRESSURE,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.automation import Condition, maybe_simple_id
|
from esphome.automation import Condition, maybe_simple_id
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
CONF_ENTITY_CATEGORY,
|
CONF_ENTITY_CATEGORY,
|
||||||
|
@ -10,11 +10,11 @@ from esphome.const import (
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_INVERTED,
|
CONF_INVERTED,
|
||||||
CONF_MQTT_ID,
|
CONF_MQTT_ID,
|
||||||
CONF_WEB_SERVER_ID,
|
|
||||||
CONF_ON_TURN_OFF,
|
CONF_ON_TURN_OFF,
|
||||||
CONF_ON_TURN_ON,
|
CONF_ON_TURN_ON,
|
||||||
CONF_RESTORE_MODE,
|
CONF_RESTORE_MODE,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
|
CONF_WEB_SERVER_ID,
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
DEVICE_CLASS_OUTLET,
|
DEVICE_CLASS_OUTLET,
|
||||||
DEVICE_CLASS_SWITCH,
|
DEVICE_CLASS_SWITCH,
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_MODE,
|
CONF_MODE,
|
||||||
|
CONF_MQTT_ID,
|
||||||
CONF_ON_VALUE,
|
CONF_ON_VALUE,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
CONF_MQTT_ID,
|
|
||||||
CONF_WEB_SERVER_ID,
|
|
||||||
CONF_VALUE,
|
CONF_VALUE,
|
||||||
|
CONF_WEB_SERVER_ID,
|
||||||
)
|
)
|
||||||
|
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
CONF_ENTITY_CATEGORY,
|
CONF_ENTITY_CATEGORY,
|
||||||
CONF_FILTERS,
|
CONF_FILTERS,
|
||||||
|
CONF_FROM,
|
||||||
CONF_ICON,
|
CONF_ICON,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_ON_VALUE,
|
|
||||||
CONF_ON_RAW_VALUE,
|
|
||||||
CONF_TRIGGER_ID,
|
|
||||||
CONF_MQTT_ID,
|
CONF_MQTT_ID,
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_ON_RAW_VALUE,
|
||||||
|
CONF_ON_VALUE,
|
||||||
CONF_STATE,
|
CONF_STATE,
|
||||||
CONF_FROM,
|
|
||||||
CONF_TO,
|
CONF_TO,
|
||||||
|
CONF_TRIGGER_ID,
|
||||||
|
CONF_WEB_SERVER_ID,
|
||||||
DEVICE_CLASS_DATE,
|
DEVICE_CLASS_DATE,
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
DEVICE_CLASS_TIMESTAMP,
|
DEVICE_CLASS_TIMESTAMP,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.automation import maybe_simple_id, Condition
|
from esphome.automation import Condition, maybe_simple_id
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt, web_server
|
from esphome.components import mqtt, web_server
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
|
Loading…
Reference in a new issue