mirror of
https://github.com/esphome/esphome.git
synced 2025-10-12 06:43:48 +01:00
Cleanup dashboard JS (#491)
* Cleanup dashboard JS * Add vscode * Save start_mark/end_mark * Updates * Updates * Remove need for cv.nameable It's a bit hacky but removes so much bloat from integrations * Add enum helper * Document APIs, and Improvements * Fixes * Fixes * Update PULL_REQUEST_TEMPLATE.md * Updates * Updates * Updates
This commit is contained in:
@@ -14,8 +14,6 @@ namespace sntp {
|
||||
/// \see https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
|
||||
class SNTPComponent : public time::RealTimeClock {
|
||||
public:
|
||||
SNTPComponent() : time::RealTimeClock() {}
|
||||
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
/// Change the servers used by SNTP for timekeeping
|
||||
|
@@ -4,6 +4,7 @@ import esphome.codegen as cg
|
||||
from esphome.const import CONF_ID, CONF_SERVERS
|
||||
|
||||
|
||||
DEPENDENCIES = ['network']
|
||||
sntp_ns = cg.esphome_ns.namespace('sntp')
|
||||
SNTPComponent = sntp_ns.class_('SNTPComponent', time_.RealTimeClock)
|
||||
|
||||
@@ -11,7 +12,7 @@ SNTPComponent = sntp_ns.class_('SNTPComponent', time_.RealTimeClock)
|
||||
DEFAULT_SERVERS = ["0.pool.ntp.org", "1.pool.ntp.org", "2.pool.ntp.org"]
|
||||
|
||||
CONFIG_SCHEMA = time_.TIME_SCHEMA.extend({
|
||||
cv.GenerateID(): cv.declare_variable_id(SNTPComponent),
|
||||
cv.GenerateID(): cv.declare_id(SNTPComponent),
|
||||
cv.Optional(CONF_SERVERS, default=DEFAULT_SERVERS):
|
||||
cv.All(cv.ensure_list(cv.domain), cv.Length(min=1, max=3)),
|
||||
}).extend(cv.COMPONENT_SCHEMA)
|
||||
|
Reference in New Issue
Block a user