empty sensor rename
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
#include "esphome/core/log.h"
|
||||||
|
#include "empty_binary_output.h"
|
||||||
|
|
||||||
|
namespace esphome {
|
||||||
|
namespace empty_binary_output {
|
||||||
|
|
||||||
|
static const char *TAG = "empty_binary_output.binary_output";
|
||||||
|
|
||||||
|
void EmptyBinaryOutput::setup(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptyBinaryOutput::write_state(bool state){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptyBinaryOutput::dump_config() {
|
||||||
|
ESP_LOGCONFIG(TAG, "Custom binary output");
|
||||||
|
}
|
||||||
|
|
||||||
|
} //namespace empty_binary_output
|
||||||
|
} //namespace esphome
|
||||||
|
|
||||||
+3
-3
@@ -4,9 +4,9 @@
|
|||||||
#include "esphome/components/output/binary_output.h"
|
#include "esphome/components/output/binary_output.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_binary_output {
|
namespace empty_binary_output {
|
||||||
|
|
||||||
class EmptyCustomBinaryOutput : public output::BinaryOutput, public Component {
|
class EmptyBinaryOutput : public output::BinaryOutput, public Component {
|
||||||
public:
|
public:
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void write_state(bool state) override;
|
void write_state(bool state) override;
|
||||||
@@ -14,5 +14,5 @@ class EmptyCustomBinaryOutput : public output::BinaryOutput, public Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} //namespace empty_custom_binary_output
|
} //namespace empty_binary_output
|
||||||
} //namespace esphome
|
} //namespace esphome
|
||||||
+3
-3
@@ -3,12 +3,12 @@ import esphome.config_validation as cv
|
|||||||
from esphome.components import output
|
from esphome.components import output
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
empty_custom_binary_output_ns = cg.esphome_ns.namespace('empty_custom_binary_output')
|
empty_binary_output_ns = cg.esphome_ns.namespace('empty_binary_output')
|
||||||
EmptyCustomBinaryOutput = empty_custom_binary_output_ns.class_('EmptyCustomBinaryOutput', output.BinaryOutput,
|
EmptyBinaryOutput = empty_binary_output_ns.class_('EmptyBinaryOutput', output.BinaryOutput,
|
||||||
cg.Component)
|
cg.Component)
|
||||||
|
|
||||||
CONFIG_SCHEMA = output.BINARY_OUTPUT_SCHEMA.extend({
|
CONFIG_SCHEMA = output.BINARY_OUTPUT_SCHEMA.extend({
|
||||||
cv.Required(CONF_ID): cv.declare_id(EmptyCustomBinaryOutput),
|
cv.Required(CONF_ID): cv.declare_id(EmptyBinaryOutput),
|
||||||
}).extend(cv.COMPONENT_SCHEMA)
|
}).extend(cv.COMPONENT_SCHEMA)
|
||||||
|
|
||||||
def to_code(config):
|
def to_code(config):
|
||||||
+3
-3
@@ -3,12 +3,12 @@ import esphome.config_validation as cv
|
|||||||
from esphome.components import binary_sensor
|
from esphome.components import binary_sensor
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
empty_custom_binary_sensor_ns = cg.esphome_ns.namespace('empty_custom_binary_sensor')
|
empty_binary_sensor_ns = cg.esphome_ns.namespace('empty_binary_sensor')
|
||||||
|
|
||||||
EmptyCustomBinarySensor = empty_custom_binary_sensor_ns.class_('EmptyCustomBinarySensor', binary_sensor.BinarySensor, cg.Component)
|
EmptyBinarySensor = empty_binary_sensor_ns.class_('EmptyBinarySensor', binary_sensor.BinarySensor, cg.Component)
|
||||||
|
|
||||||
CONFIG_SCHEMA = binary_sensor.BINARY_SENSOR_SCHEMA.extend({
|
CONFIG_SCHEMA = binary_sensor.BINARY_SENSOR_SCHEMA.extend({
|
||||||
cv.GenerateID(): cv.declare_id(EmptyCustomBinarySensor),
|
cv.GenerateID(): cv.declare_id(EmptyBinarySensor),
|
||||||
}).extend(cv.COMPONENT_SCHEMA)
|
}).extend(cv.COMPONENT_SCHEMA)
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#include "esphome/core/log.h"
|
||||||
|
#include "empty_binary_sensor.h"
|
||||||
|
|
||||||
|
namespace esphome {
|
||||||
|
namespace empty_binary_sensor {
|
||||||
|
|
||||||
|
static const char *TAG = "empty_binary_sensor.binary_sensor";
|
||||||
|
|
||||||
|
void EmptyBinarySensor::setup() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptyBinarySensor::update() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptyBinarySensor::dump_config() {
|
||||||
|
ESP_LOGCONFIG(TAG, "Custom binary sensor");
|
||||||
|
}
|
||||||
|
|
||||||
|
} //namespace empty_binary_sensor
|
||||||
|
} //namespace esphome
|
||||||
+3
-3
@@ -4,14 +4,14 @@
|
|||||||
#include "esphome/components/binary_sensor/binary_sensor.h"
|
#include "esphome/components/binary_sensor/binary_sensor.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_binary_sensor {
|
namespace empty_binary_sensor {
|
||||||
|
|
||||||
class EmptyCustomBinarySensor : public binary_sensor::BinarySensor, public PollingComponent {
|
class EmptyBinarySensor : public binary_sensor::BinarySensor, public PollingComponent {
|
||||||
public:
|
public:
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void update() override;
|
void update() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace empty_custom_binary_sensor
|
} //namespace empty_binary_sensor
|
||||||
} //namespace esphome
|
} //namespace esphome
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#include "esphome/core/log.h"
|
|
||||||
#include "empty_custom_binary_output.h"
|
|
||||||
|
|
||||||
namespace esphome {
|
|
||||||
namespace empty_custom_binary_output {
|
|
||||||
|
|
||||||
static const char *TAG = "empty_custom_binary_output.binary_output";
|
|
||||||
|
|
||||||
void EmptyCustomBinaryOutput::setup(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomBinaryOutput::write_state(bool state){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomBinaryOutput::dump_config() {
|
|
||||||
ESP_LOGCONFIG(TAG, "Custom binary output");
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace empty_custom_binary_output
|
|
||||||
} //namespace esphome
|
|
||||||
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#include "esphome/core/log.h"
|
|
||||||
#include "empty_custom_binary_sensor.h"
|
|
||||||
|
|
||||||
namespace esphome {
|
|
||||||
namespace empty_custom_binary_sensor {
|
|
||||||
|
|
||||||
static const char *TAG = "empty_custom_binary_sensor.binary_sensor";
|
|
||||||
|
|
||||||
void EmptyCustomBinarySensor::setup() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomBinarySensor::update() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomBinarySensor::dump_config() {
|
|
||||||
ESP_LOGCONFIG(TAG, "Custom binary sensor");
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace empty_custom_binary_sensor
|
|
||||||
} //namespace esphome
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
import esphome.codegen as cg
|
|
||||||
|
|
||||||
empty_custom_fan_ns = cg.esphome_ns.namespace('empty_custom_fan')
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#include "esphome/core/log.h"
|
|
||||||
#include "empty_custom_float_output.h"
|
|
||||||
|
|
||||||
namespace esphome {
|
|
||||||
namespace empty_custom_float_output {
|
|
||||||
|
|
||||||
static const char *TAG = "empty_custom_float_output.output";
|
|
||||||
|
|
||||||
void EmptyCustomFloatOutput::setup(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomFloatOutput::write_state(float state){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomFloatOutput::dump_config() {
|
|
||||||
ESP_LOGCONFIG(TAG, "Empty custom float output");
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace empty_custom_float_output
|
|
||||||
} //namespace esphome
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#include "esphome/core/log.h"
|
|
||||||
#include "empty_custom_sensor.h"
|
|
||||||
|
|
||||||
namespace esphome {
|
|
||||||
namespace empty_custom_sensor {
|
|
||||||
|
|
||||||
static const char *TAG = "empty_custom_sensor.sensor";
|
|
||||||
|
|
||||||
void EmptyCustomSensor::setup() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomSensor::loop() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomSensor::update() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomSensor::dump_config() {
|
|
||||||
ESP_LOGCONFIG(TAG, "Empty custom sensor");
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace empty_custom_sensor
|
|
||||||
} //namespace esphome
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#include "esphome/core/log.h"
|
|
||||||
#include "empty_custom_switch.h"
|
|
||||||
|
|
||||||
namespace esphome {
|
|
||||||
namespace empty_custom_switch {
|
|
||||||
|
|
||||||
static const char *TAG = "empty_custom_switch.switch";
|
|
||||||
|
|
||||||
void EmptyCustomSwitch::setup() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomSwitch::write_state(bool state) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyCustomSwitch::dump_config(){
|
|
||||||
ESP_LOGCONFIG(TAG, "Empty custom switch");
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace empty_custom_switch
|
|
||||||
} //namespace esphome
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import esphome.codegen as cg
|
||||||
|
|
||||||
|
empty_fan_ns = cg.esphome_ns.namespace('empty_fan')
|
||||||
+3
-3
@@ -3,12 +3,12 @@ import esphome.config_validation as cv
|
|||||||
from esphome.components import fan, output
|
from esphome.components import fan, output
|
||||||
from esphome.const import CONF_DIRECTION_OUTPUT, CONF_OSCILLATION_OUTPUT, \
|
from esphome.const import CONF_DIRECTION_OUTPUT, CONF_OSCILLATION_OUTPUT, \
|
||||||
CONF_OUTPUT, CONF_OUTPUT_ID
|
CONF_OUTPUT, CONF_OUTPUT_ID
|
||||||
from .. import empty_custom_fan_ns
|
from .. import empty_fan_ns
|
||||||
|
|
||||||
EmptyCustomFan = empty_custom_fan_ns.class_('EmptyCustomFan', cg.Component)
|
EmptyFan = empty_fan_ns.class_('EmptyFan', cg.Component)
|
||||||
|
|
||||||
CONFIG_SCHEMA = fan.FAN_SCHEMA.extend({
|
CONFIG_SCHEMA = fan.FAN_SCHEMA.extend({
|
||||||
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(EmptyCustomFan),
|
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(EmptyFan),
|
||||||
cv.Required(CONF_OUTPUT): cv.use_id(output.BinaryOutput),
|
cv.Required(CONF_OUTPUT): cv.use_id(output.BinaryOutput),
|
||||||
cv.Optional(CONF_DIRECTION_OUTPUT): cv.use_id(output.BinaryOutput),
|
cv.Optional(CONF_DIRECTION_OUTPUT): cv.use_id(output.BinaryOutput),
|
||||||
cv.Optional(CONF_OSCILLATION_OUTPUT): cv.use_id(output.BinaryOutput),
|
cv.Optional(CONF_OSCILLATION_OUTPUT): cv.use_id(output.BinaryOutput),
|
||||||
+7
-7
@@ -1,12 +1,12 @@
|
|||||||
#include "empty_custom_fan.h"
|
#include "empty_fan.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_fan {
|
namespace empty_fan {
|
||||||
|
|
||||||
static const char *TAG = "empty_custom_fan.fan";
|
static const char *TAG = "empty_fan.fan";
|
||||||
|
|
||||||
void EmptyCustomFan::setup() {
|
void EmptyFan::setup() {
|
||||||
auto traits = fan::FanTraits();
|
auto traits = fan::FanTraits();
|
||||||
traits.set_direction(false);
|
traits.set_direction(false);
|
||||||
traits.set_oscillation(false);
|
traits.set_oscillation(false);
|
||||||
@@ -17,7 +17,7 @@ void EmptyCustomFan::setup() {
|
|||||||
this->fan_->add_on_state_callback([this]() { this->next_update_ = true; });
|
this->fan_->add_on_state_callback([this]() { this->next_update_ = true; });
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmptyCustomFan::loop() {
|
void EmptyFan::loop() {
|
||||||
if (!this->next_update_) {
|
if (!this->next_update_) {
|
||||||
return; //no state change, nothing to do
|
return; //no state change, nothing to do
|
||||||
}
|
}
|
||||||
@@ -26,9 +26,9 @@ void EmptyCustomFan::loop() {
|
|||||||
//there was a state change, do something here.
|
//there was a state change, do something here.
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmptyCustomFan::dump_config() {
|
void EmptyFan::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, "Empty fan");
|
ESP_LOGCONFIG(TAG, "Empty fan");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace binary
|
} // namespace binary
|
||||||
} // namespace empty_custom_fan
|
} // namespace empty_fan
|
||||||
+3
-3
@@ -5,9 +5,9 @@
|
|||||||
#include "esphome/components/fan/fan_state.h"
|
#include "esphome/components/fan/fan_state.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_fan {
|
namespace empty_fan {
|
||||||
|
|
||||||
class EmptyCustomFan : public Component {
|
class EmptyFan : public Component {
|
||||||
public:
|
public:
|
||||||
void set_fan(fan::FanState *fan) { fan_ = fan; }
|
void set_fan(fan::FanState *fan) { fan_ = fan; }
|
||||||
void set_output(output::BinaryOutput *output) { output_ = output; }
|
void set_output(output::BinaryOutput *output) { output_ = output; }
|
||||||
@@ -21,5 +21,5 @@ class EmptyCustomFan : public Component {
|
|||||||
bool next_update_{true};
|
bool next_update_{true};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace empty_custom_fan
|
} // namespace empty_fan
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#include "esphome/core/log.h"
|
||||||
|
#include "empty_float_output.h"
|
||||||
|
|
||||||
|
namespace esphome {
|
||||||
|
namespace empty_float_output {
|
||||||
|
|
||||||
|
static const char *TAG = "empty_float_output.output";
|
||||||
|
|
||||||
|
void EmptyFloatOutput::setup(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptyFloatOutput::write_state(float state){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptyFloatOutput::dump_config() {
|
||||||
|
ESP_LOGCONFIG(TAG, "Empty custom float output");
|
||||||
|
}
|
||||||
|
|
||||||
|
} //namespace empty_float_output
|
||||||
|
} //namespace esphome
|
||||||
|
|
||||||
+3
-3
@@ -4,9 +4,9 @@
|
|||||||
#include "esphome/components/output/float_output.h"
|
#include "esphome/components/output/float_output.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_float_output {
|
namespace empty_float_output {
|
||||||
|
|
||||||
class EmptyCustomFloatOutput : public output::FloatOutput, public Component {
|
class EmptyFloatOutput : public output::FloatOutput, public Component {
|
||||||
public:
|
public:
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void write_state(float state) override;
|
void write_state(float state) override;
|
||||||
@@ -14,5 +14,5 @@ class EmptyCustomFloatOutput : public output::FloatOutput, public Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} //namespace empty_custom_float_output
|
} //namespace empty_float_output
|
||||||
} //namespace esphome
|
} //namespace esphome
|
||||||
+3
-3
@@ -3,12 +3,12 @@ import esphome.config_validation as cv
|
|||||||
from esphome.components import output
|
from esphome.components import output
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
empty_custom_float_output_ns = cg.esphome_ns.namespace('empty_custom_float_output')
|
empty_float_output_ns = cg.esphome_ns.namespace('empty_float_output')
|
||||||
EmptyCustomFloatOutput = empty_custom_float_output_ns.class_('EmptyCustomFloatOutput', output.FloatOutput,
|
EmptyFloatOutput = empty_float_output_ns.class_('EmptyFloatOutput', output.FloatOutput,
|
||||||
cg.Component)
|
cg.Component)
|
||||||
|
|
||||||
CONFIG_SCHEMA = output.FLOAT_OUTPUT_SCHEMA.extend({
|
CONFIG_SCHEMA = output.FLOAT_OUTPUT_SCHEMA.extend({
|
||||||
cv.Required(CONF_ID): cv.declare_id(EmptyCustomFloatOutput),
|
cv.Required(CONF_ID): cv.declare_id(EmptyFloatOutput),
|
||||||
}).extend(cv.COMPONENT_SCHEMA)
|
}).extend(cv.COMPONENT_SCHEMA)
|
||||||
|
|
||||||
def to_code(config):
|
def to_code(config):
|
||||||
+8
-8
@@ -1,16 +1,16 @@
|
|||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
#include "empty_custom_light.h"
|
#include "empty_light.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_light {
|
namespace empty_light {
|
||||||
|
|
||||||
static const char *TAG = "empty_custom_light.light";
|
static const char *TAG = "empty_light.light";
|
||||||
|
|
||||||
void EmptyCustomLightOutput::setup() {
|
void EmptyLightOutput::setup() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
light::LightTraits EmptyCustomLightOutput::get_traits() {
|
light::LightTraits EmptyLightOutput::get_traits() {
|
||||||
auto traits = light::LightTraits();
|
auto traits = light::LightTraits();
|
||||||
traits.set_supports_brightness(true);
|
traits.set_supports_brightness(true);
|
||||||
traits.set_supports_rgb(false);
|
traits.set_supports_rgb(false);
|
||||||
@@ -20,13 +20,13 @@ light::LightTraits EmptyCustomLightOutput::get_traits() {
|
|||||||
return traits;
|
return traits;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmptyCustomLightOutput::write_state(light::LightState *state) {
|
void EmptyLightOutput::write_state(light::LightState *state) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmptyCustomLightOutput::dump_config(){
|
void EmptyLightOutput::dump_config(){
|
||||||
ESP_LOGCONFIG(TAG, "Empty custom light");
|
ESP_LOGCONFIG(TAG, "Empty custom light");
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace empty_custom_light
|
} //namespace empty_light
|
||||||
} //namespace esphome
|
} //namespace esphome
|
||||||
+3
-3
@@ -5,9 +5,9 @@
|
|||||||
#include "esphome/components/light/light_output.h"
|
#include "esphome/components/light/light_output.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_light {
|
namespace empty_light {
|
||||||
|
|
||||||
class EmptyCustomLightOutput : public light::LightOutput, public Component {
|
class EmptyLightOutput : public light::LightOutput, public Component {
|
||||||
public:
|
public:
|
||||||
void setup() override;
|
void setup() override;
|
||||||
light::LightTraits get_traits() override;
|
light::LightTraits get_traits() override;
|
||||||
@@ -19,5 +19,5 @@ class EmptyCustomLightOutput : public light::LightOutput, public Component {
|
|||||||
output::FloatOutput *output_;
|
output::FloatOutput *output_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace empty_custom_light
|
} //namespace empty_light
|
||||||
} //namespace esphome
|
} //namespace esphome
|
||||||
+3
-3
@@ -3,11 +3,11 @@ import esphome.config_validation as cv
|
|||||||
from esphome.components import light, output
|
from esphome.components import light, output
|
||||||
from esphome.const import CONF_OUTPUT_ID, CONF_OUTPUT
|
from esphome.const import CONF_OUTPUT_ID, CONF_OUTPUT
|
||||||
|
|
||||||
empty_custom_light_ns = cg.esphome_ns.namespace('empty_custom_light')
|
empty_light_ns = cg.esphome_ns.namespace('empty_light')
|
||||||
EmptyCustomLightOutput = empty_custom_light_ns.class_('EmptyCustomLightOutput', light.LightOutput)
|
EmptyLightOutput = empty_light_ns.class_('EmptyLightOutput', light.LightOutput)
|
||||||
|
|
||||||
CONFIG_SCHEMA = light.BRIGHTNESS_ONLY_LIGHT_SCHEMA.extend({
|
CONFIG_SCHEMA = light.BRIGHTNESS_ONLY_LIGHT_SCHEMA.extend({
|
||||||
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(EmptyCustomLightOutput),
|
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(EmptyLightOutput),
|
||||||
cv.Required(CONF_OUTPUT): cv.use_id(output.FloatOutput)
|
cv.Required(CONF_OUTPUT): cv.use_id(output.FloatOutput)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#include "esphome/core/log.h"
|
||||||
|
#include "empty_sensor.h"
|
||||||
|
|
||||||
|
namespace esphome {
|
||||||
|
namespace empty_sensor {
|
||||||
|
|
||||||
|
static const char *TAG = "empty_sensor.sensor";
|
||||||
|
|
||||||
|
void EmptySensor::setup() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptySensor::loop() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptySensor::update() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptySensor::dump_config() {
|
||||||
|
ESP_LOGCONFIG(TAG, "Empty custom sensor");
|
||||||
|
}
|
||||||
|
|
||||||
|
} //namespace empty_sensor
|
||||||
|
} //namespace esphome
|
||||||
+3
-3
@@ -4,14 +4,14 @@
|
|||||||
#include "esphome/components/sensor/sensor.h"
|
#include "esphome/components/sensor/sensor.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_sensor {
|
namespace empty_sensor {
|
||||||
|
|
||||||
class EmptyCustomSensor : public sensor::Sensor, public PollingComponent {
|
class EmptySensor : public sensor::Sensor, public PollingComponent {
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void loop() override;
|
void loop() override;
|
||||||
void update() override;
|
void update() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace empty_custom_sensor
|
} //namespace empty_sensor
|
||||||
} //namespace esphome
|
} //namespace esphome
|
||||||
+3
-3
@@ -3,12 +3,12 @@ import esphome.config_validation as cv
|
|||||||
from esphome.components import sensor
|
from esphome.components import sensor
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
empty_custom_sensor_ns = cg.esphome_ns.namespace('empty_custom_sensor')
|
empty_sensor_ns = cg.esphome_ns.namespace('empty_sensor')
|
||||||
|
|
||||||
EmptyCustomSensor = empty_custom_sensor_ns.class_('EmptyCustomSensor', cg.PollingComponent)
|
EmptySensor = empty_sensor_ns.class_('EmptySensor', cg.PollingComponent)
|
||||||
|
|
||||||
CONFIG_SCHEMA = cv.Schema({
|
CONFIG_SCHEMA = cv.Schema({
|
||||||
cv.GenerateID(): cv.declare_id(EmptyCustomSensor)
|
cv.GenerateID(): cv.declare_id(EmptySensor)
|
||||||
}).extend(cv.polling_component_schema('60s'))
|
}).extend(cv.polling_component_schema('60s'))
|
||||||
|
|
||||||
def to_code(config):
|
def to_code(config):
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#include "esphome/core/log.h"
|
||||||
|
#include "empty_switch.h"
|
||||||
|
|
||||||
|
namespace esphome {
|
||||||
|
namespace empty_switch {
|
||||||
|
|
||||||
|
static const char *TAG = "empty_switch.switch";
|
||||||
|
|
||||||
|
void EmptySwitch::setup() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptySwitch::write_state(bool state) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptySwitch::dump_config(){
|
||||||
|
ESP_LOGCONFIG(TAG, "Empty custom switch");
|
||||||
|
}
|
||||||
|
|
||||||
|
} //namespace empty_switch
|
||||||
|
} //namespace esphome
|
||||||
+3
-3
@@ -4,14 +4,14 @@
|
|||||||
#include "esphome/components/switch/switch.h"
|
#include "esphome/components/switch/switch.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace empty_custom_switch {
|
namespace empty_switch {
|
||||||
|
|
||||||
class EmptyCustomSwitch : public switch_::Switch, public Component {
|
class EmptySwitch : public switch_::Switch, public Component {
|
||||||
public:
|
public:
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void write_state(bool state) override;
|
void write_state(bool state) override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace empty_custom_switch
|
} //namespace empty_switch
|
||||||
} //namespace esphome
|
} //namespace esphome
|
||||||
+3
-3
@@ -3,11 +3,11 @@ import esphome.config_validation as cv
|
|||||||
from esphome.components import switch
|
from esphome.components import switch
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
empty_custom_switch_ns = cg.esphome_ns.namespace('empty_custom_switch')
|
empty_switch_ns = cg.esphome_ns.namespace('empty_switch')
|
||||||
EmptyCustomSwitch = empty_custom_switch_ns.class_('EmptyCustomSwitch', switch.Switch, cg.Component)
|
EmptySwitch = empty_switch_ns.class_('EmptySwitch', switch.Switch, cg.Component)
|
||||||
|
|
||||||
CONFIG_SCHEMA = switch.SWITCH_SCHEMA.extend({
|
CONFIG_SCHEMA = switch.SWITCH_SCHEMA.extend({
|
||||||
cv.GenerateID(): cv.declare_id(EmptyCustomSwitch)
|
cv.GenerateID(): cv.declare_id(EmptySwitch)
|
||||||
}).extend(cv.COMPONENT_SCHEMA)
|
}).extend(cv.COMPONENT_SCHEMA)
|
||||||
|
|
||||||
def to_code(config):
|
def to_code(config):
|
||||||
+16
-16
@@ -2,33 +2,33 @@ packages:
|
|||||||
device: !include device.yaml
|
device: !include device.yaml
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: empty_custom_sensor
|
- platform: empty_sensor
|
||||||
id: empty_custom_sensor_1
|
id: empty_sensor_1
|
||||||
|
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: empty_custom_binary_sensor
|
- platform: empty_binary_sensor
|
||||||
id: empty_custom_binary_sensor_1
|
id: empty_binary_sensor_1
|
||||||
|
|
||||||
output:
|
output:
|
||||||
- platform: empty_custom_binary_output
|
- platform: empty_binary_output
|
||||||
id: empty_custom_binary_output_1
|
id: empty_binary_output_1
|
||||||
|
|
||||||
- platform: empty_custom_float_output
|
- platform: empty_float_output
|
||||||
id: empty_custom_float_output_1
|
id: empty_float_output_1
|
||||||
|
|
||||||
light:
|
light:
|
||||||
- platform: empty_custom_light
|
- platform: empty_light
|
||||||
id: empty_custom_light_1
|
id: empty_light_1
|
||||||
output: empty_custom_float_output_1
|
output: empty_float_output_1
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
- platform: empty_custom_switch
|
- platform: empty_switch
|
||||||
id: empty_custom_switch_1
|
id: empty_switch_1
|
||||||
|
|
||||||
fan:
|
fan:
|
||||||
- platform: empty_custom_fan
|
- platform: empty_fan
|
||||||
id: empty_custom_fan_1
|
id: empty_fan_1
|
||||||
output: empty_custom_binary_output_1
|
output: empty_binary_output_1
|
||||||
|
|
||||||
text_sensor:
|
text_sensor:
|
||||||
- platform: empty_text_sensor
|
- platform: empty_text_sensor
|
||||||
|
|||||||
Reference in New Issue
Block a user