mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	[code-quality] fix clang-tidy md5 and hmac_md5 (#7325)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
		| @@ -1,6 +1,7 @@ | |||||||
| #include <cstdio> | #include <cstdio> | ||||||
| #include <cstring> | #include <cstring> | ||||||
| #include "hmac_md5.h" | #include "hmac_md5.h" | ||||||
|  | #ifdef USE_MD5 | ||||||
| #include "esphome/core/helpers.h" | #include "esphome/core/helpers.h" | ||||||
|  |  | ||||||
| namespace esphome { | namespace esphome { | ||||||
| @@ -54,3 +55,4 @@ bool HmacMD5::equals_hex(const char *expected) { return this->ohash_.equals_hex( | |||||||
|  |  | ||||||
| }  // namespace hmac_md5 | }  // namespace hmac_md5 | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| #pragma once | #pragma once | ||||||
|  |  | ||||||
| #include "esphome/core/defines.h" | #include "esphome/core/defines.h" | ||||||
|  | #ifdef USE_MD5 | ||||||
| #include "esphome/components/md5/md5.h" | #include "esphome/components/md5/md5.h" | ||||||
|  |  | ||||||
| #include <string> | #include <string> | ||||||
|  |  | ||||||
| namespace esphome { | namespace esphome { | ||||||
| @@ -46,3 +46,4 @@ class HmacMD5 { | |||||||
|  |  | ||||||
| }  // namespace hmac_md5 | }  // namespace hmac_md5 | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1 +1,7 @@ | |||||||
|  | import esphome.codegen as cg | ||||||
|  |  | ||||||
| CODEOWNERS = ["@esphome/core"] | CODEOWNERS = ["@esphome/core"] | ||||||
|  |  | ||||||
|  |  | ||||||
|  | async def to_code(config): | ||||||
|  |     cg.add_define("USE_MD5") | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| #include <cstdio> | #include <cstdio> | ||||||
| #include <cstring> | #include <cstring> | ||||||
| #include "md5.h" | #include "md5.h" | ||||||
|  | #ifdef USE_MD5 | ||||||
| #include "esphome/core/helpers.h" | #include "esphome/core/helpers.h" | ||||||
|  |  | ||||||
| namespace esphome { | namespace esphome { | ||||||
| @@ -65,3 +66,4 @@ bool MD5Digest::equals_hex(const char *expected) { | |||||||
|  |  | ||||||
| }  // namespace md5 | }  // namespace md5 | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| #pragma once | #pragma once | ||||||
|  |  | ||||||
| #include "esphome/core/defines.h" | #include "esphome/core/defines.h" | ||||||
|  | #ifdef USE_MD5 | ||||||
|  |  | ||||||
| #ifdef USE_ESP_IDF | #ifdef USE_ESP_IDF | ||||||
| #include "esp_rom_md5.h" | #include "esp_rom_md5.h" | ||||||
| @@ -66,3 +67,4 @@ class MD5Digest { | |||||||
|  |  | ||||||
| }  // namespace md5 | }  // namespace md5 | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|  | #endif | ||||||
|   | |||||||
| @@ -50,6 +50,7 @@ | |||||||
| #define USE_LVGL_KEYBOARD | #define USE_LVGL_KEYBOARD | ||||||
| #define USE_LVGL_ROTARY_ENCODER | #define USE_LVGL_ROTARY_ENCODER | ||||||
| #define USE_LVGL_TOUCHSCREEN | #define USE_LVGL_TOUCHSCREEN | ||||||
|  | #define USE_MD5 | ||||||
| #define USE_MDNS | #define USE_MDNS | ||||||
| #define USE_MEDIA_PLAYER | #define USE_MEDIA_PLAYER | ||||||
| #define USE_MQTT | #define USE_MQTT | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user