Skip to content

Commit

Permalink
twek switch python
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Oct 27, 2023
1 parent eb5071e commit b1f0567
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
29 changes: 29 additions & 0 deletions components/BalboaGL/switch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import switch
from esphome.const import CONF_ID

from .. import balboa_ns, CONF_BALBOA_ID, BalboaGL

DEPENDENCIES = ["BalboaGL"]

LightSwitch = cg.esphome_ns.class_('LightSwitch', switch.Switch, cg.Component)

CONFIG_SCHEMA = (
switch.switch_schema(LightSwitch)
.extend(
{
cv.GenerateID(CONF_BALBOA_ID): cv.use_id(BalboaGL),
}
)
.extend(cv.COMPONENT_SCHEMA)
)

async def to_code(config):
var = await switch.new_switch(config)
await cg.register_component(var, config)

paren = await cg.get_variable(config[CONF_BALBOA_ID])
# cg.add(var.set_balboa_parent(paren))
# cg.add(cg.RawExpression("balboaglclimate->set_spa(balboagl->get_spa())"))

28 changes: 0 additions & 28 deletions components/BalboaGL/switch/switch.py

This file was deleted.

0 comments on commit b1f0567

Please sign in to comment.