mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-10 02:46:53 +00:00
Make the example work as is (#3630)
The HVAC component will not appear without valid initial values sent from the sketch. Initial default values added to avoid the problem.
This commit is contained in:
parent
f762f779a2
commit
b5119b9d57
@ -98,6 +98,8 @@ MyMessage msgHVACSetPointC(CHILD_ID_HVAC, V_HVAC_SETPOINT_COOL);
|
|||||||
MyMessage msgHVACSpeed(CHILD_ID_HVAC, V_HVAC_SPEED);
|
MyMessage msgHVACSpeed(CHILD_ID_HVAC, V_HVAC_SPEED);
|
||||||
MyMessage msgHVACFlowState(CHILD_ID_HVAC, V_HVAC_FLOW_STATE);
|
MyMessage msgHVACFlowState(CHILD_ID_HVAC, V_HVAC_FLOW_STATE);
|
||||||
|
|
||||||
|
bool initialValueSent = false;
|
||||||
|
|
||||||
void presentation() {
|
void presentation() {
|
||||||
sendSketchInfo("Heatpump", "2.1");
|
sendSketchInfo("Heatpump", "2.1");
|
||||||
present(CHILD_ID_HVAC, S_HVAC, "Thermostat");
|
present(CHILD_ID_HVAC, S_HVAC, "Thermostat");
|
||||||
@ -108,6 +110,13 @@ void setup() {
|
|||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
// put your main code here, to run repeatedly:
|
// put your main code here, to run repeatedly:
|
||||||
|
if (!initialValueSent) {
|
||||||
|
send(msgHVACSetPointC.set(20));
|
||||||
|
send(msgHVACSpeed.set("Auto"));
|
||||||
|
send(msgHVACFlowState.set("Off"));
|
||||||
|
|
||||||
|
initialValueSent = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void receive(const MyMessage &message) {
|
void receive(const MyMessage &message) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user