mirror of
https://github.com/esphome/esphome.git
synced 2025-09-18 19:22:22 +01:00
Formating updates
This commit is contained in:
@@ -2,8 +2,8 @@ from esphome import config_validation as cv
|
||||
from esphome import codegen as cg
|
||||
from esphome.const import CONF_ID, CONF_NAME
|
||||
|
||||
# DeviceStruct = cg.esphome_ns.struct("Device")
|
||||
# StringVar = cg.std_ns.struct("string")
|
||||
# ns = cg.esphome_ns.namespace("device")
|
||||
# DeviceClass = ns.Class("Device")
|
||||
StringRef = cg.esphome_ns.struct("StringRef")
|
||||
|
||||
MULTI_CONF = True
|
||||
@@ -12,8 +12,7 @@ CODEOWNERS = ["@dala318"]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
{
|
||||
# cv.Required(CONF_ID): cv.declare_id(DeviceStruct),
|
||||
# cv.Required(CONF_ID): cv.declare_id(StringVar),
|
||||
# cv.Required(CONF_ID): cv.declare_id(DeviceClass),
|
||||
cv.Required(CONF_ID): cv.declare_id(StringRef),
|
||||
cv.Required(CONF_NAME): cv.string,
|
||||
}
|
||||
@@ -21,10 +20,6 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
# cg.new_variable(
|
||||
# config[CONF_ID],
|
||||
# config[CONF_NAME],
|
||||
# )
|
||||
cg.new_Pvariable(
|
||||
config[CONF_ID],
|
||||
config[CONF_NAME],
|
||||
|
@@ -1,14 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
namespace esphome {
|
||||
namespace device {
|
||||
|
||||
class Device {
|
||||
public:
|
||||
void set_name(std::string name) { name_ = name; }
|
||||
std::string get_name(void) {return name_;}
|
||||
std::string get_name(void) { return name_; }
|
||||
|
||||
protected:
|
||||
std::string name_ = "";
|
||||
};
|
||||
|
||||
} // namespace device
|
||||
} // namespace esphome
|
||||
|
Reference in New Issue
Block a user