mirror of
https://github.com/esphome/esphome.git
synced 2026-02-28 01:44:20 -07:00
[dsmr] Add deprecated std::string overload for set_decryption_key (#14180)
This commit is contained in:
@@ -64,6 +64,9 @@ class Dsmr : public Component, public uart::UARTDevice {
|
|||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
void set_decryption_key(const char *decryption_key);
|
void set_decryption_key(const char *decryption_key);
|
||||||
|
// Remove before 2026.8.0
|
||||||
|
ESPDEPRECATED("Pass .c_str() - e.g. set_decryption_key(key.c_str()). Removed in 2026.8.0", "2026.2.0")
|
||||||
|
void set_decryption_key(const std::string &decryption_key) { this->set_decryption_key(decryption_key.c_str()); }
|
||||||
void set_max_telegram_length(size_t length) { this->max_telegram_len_ = length; }
|
void set_max_telegram_length(size_t length) { this->max_telegram_len_ = length; }
|
||||||
void set_request_pin(GPIOPin *request_pin) { this->request_pin_ = request_pin; }
|
void set_request_pin(GPIOPin *request_pin) { this->request_pin_ = request_pin; }
|
||||||
void set_request_interval(uint32_t interval) { this->request_interval_ = interval; }
|
void set_request_interval(uint32_t interval) { this->request_interval_ = interval; }
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
|
esphome:
|
||||||
|
on_boot:
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
// Test deprecated std::string overload still compiles
|
||||||
|
std::string key = "00112233445566778899aabbccddeeff";
|
||||||
|
id(dsmr_instance).set_decryption_key(key);
|
||||||
|
|
||||||
dsmr:
|
dsmr:
|
||||||
|
id: dsmr_instance
|
||||||
decryption_key: 00112233445566778899aabbccddeeff
|
decryption_key: 00112233445566778899aabbccddeeff
|
||||||
max_telegram_length: 1000
|
max_telegram_length: 1000
|
||||||
request_pin: ${request_pin}
|
request_pin: ${request_pin}
|
||||||
|
|||||||
Reference in New Issue
Block a user