diff --git a/src/communication.h b/src/communication.h index 260a4e7..369645a 100644 --- a/src/communication.h +++ b/src/communication.h @@ -20,13 +20,13 @@ struct CanMember { std::uint16_t getResponseId() const { return getWriteId() | 0x200; } }; -static const CanMember ESPClient{0x6a2, "ESPClient"}; -static const CanMember Anfrage{0x6a1, "Anfrage"}; -static const CanMember Kessel{0x180, "Kessel"}; -static const CanMember HK1{0x301, "HK1"}; -static const CanMember HK2{0x302, "HK2"}; +static const CanMember ESPClient{ESPCLIENT_ID, "ESPClient"}; +static const CanMember Manager{MANAGER_ID, "Manager"}; +static const CanMember Kessel{KESSEL_ID, "Kessel"}; +static const CanMember HK1{HK1_ID, "HK1"}; +static const CanMember HK2{HK2_ID, "HK2"}; -static const std::vector> canMembers{Anfrage, Kessel, HK1, HK2}; +static const std::vector> canMembers{Kessel, HK1, HK2, Manager, ESPClient}; using Request = std::pair; static std::queue request_queue; diff --git a/yaml/common.yaml b/yaml/common.yaml index 15155a4..bf7eb60 100644 --- a/yaml/common.yaml +++ b/yaml/common.yaml @@ -9,6 +9,20 @@ esphome: - OneESP32ToRuleThemAll/src/simple_variant.h - OneESP32ToRuleThemAll/src/type.h - OneESP32ToRuleThemAll/src/type.cpp + platformio_options: + build_flags: + - "-DESPCLIENT_ID=$espclient_can_id" + - "-DMANAGER_ID=$manager_can_id" + - "-DKESSEL_ID=$kessel_can_id" + - "-DHK1_ID=$hk1_can_id" + - "-DHK2_ID=$hk2_can_id" + +substitutions: + kessel_can_id: "0x180" + hk1_can_id: "0x301" + hk2_can_id: "0x302" + manager_can_id: "0x6a1" + espclient_can_id: "0x6a2" ######################################### # # @@ -152,7 +166,7 @@ sensor: ######################################### canbus: - id: wp_can - can_id: 680 + can_id: $espclient_can_id use_extended_id: false bit_rate: 20kbps on_frame: