diff --git a/esphome/components/dsmr/dsmr.h b/esphome/components/dsmr/dsmr.h index c76a23fde41..626a389c1f7 100644 --- a/esphome/components/dsmr/dsmr.h +++ b/esphome/components/dsmr/dsmr.h @@ -18,22 +18,27 @@ #if __has_include() #include -using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmTfPsa; #elif __has_include() #if __has_include() #include #endif #include -using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmMbedTls; #elif __has_include() #include -using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmBearSsl; #else #error "The platform doesn't provide a compatible encryption library for dsmr_parser" #endif namespace esphome::dsmr { +#if __has_include() +using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmTfPsa; +#elif __has_include() +using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmMbedTls; +#else +using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmBearSsl; +#endif + using namespace dsmr_parser::fields; #ifndef DSMR_SENSOR_LIST