Skip to content

Commit 5f328b9

Browse files
authored
Merge pull request #6 from mapero/bugfix/schema
Add Garage Door Vent button to HCPBridge cover example and fix schema
2 parents b7c98ac + f9911f7 commit 5f328b9

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.github/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Gitignore settings for ESPHome
2+
# This is an example and may include too much for your use-case.
3+
# You can modify this file to suit your needs.
4+
/.esphome/
5+
/secrets.yaml

.github/example_build_hcpbridge.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ hcpbridge:
2929
cover:
3030
- platform: hcpbridge
3131
name: Garage Door
32+
id: garagedoor_cover
3233

3334
switch:
3435
- platform: hcpbridge
@@ -38,4 +39,12 @@ wifi:
3839
ssid: "My Network"
3940
password: "My Password"
4041

41-
api:
42+
api:
43+
44+
45+
button:
46+
platform: template
47+
name: "Garage Door Vent"
48+
on_press:
49+
- lambda: |-
50+
id(garagedoor_cover).on_go_to_vent();

components/hcpbridge/cover/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import esphome.config_validation as cv
33
import esphome.codegen as cg
44
from esphome.const import (
5-
CONF_OUTPUT_ID
5+
CONF_ID
66
)
77

88
from .. import hcpbridge_ns, HCPBridge, CONF_HCPBridge_ID
@@ -13,13 +13,13 @@
1313

1414
CONFIG_SCHEMA = cv.All(
1515
cover.COVER_SCHEMA.extend({
16-
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(HCPBridgeCover),
16+
cv.GenerateID(): cv.declare_id(HCPBridgeCover),
1717
cv.GenerateID(CONF_HCPBridge_ID): cv.use_id(HCPBridge),
1818
}).extend(cv.polling_component_schema("500ms")),
1919
)
2020

2121
async def to_code(config):
22-
var = cg.new_Pvariable(config[CONF_OUTPUT_ID])
22+
var = cg.new_Pvariable(config[CONF_ID])
2323
await cg.register_component(var, config)
2424
await cover.register_cover(var, config)
2525
parent = await cg.get_variable(config[CONF_HCPBridge_ID])

0 commit comments

Comments
 (0)