Skip to content

Commit

Permalink
Add opt type to util
Browse files Browse the repository at this point in the history
  • Loading branch information
lanwin committed Feb 7, 2024
1 parent d517de2 commit 85f0f57
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/samsung_ac/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <bitset>
#include <optional>
#include <functional>
#include <experimental/optional>

namespace esphome
{
Expand All @@ -18,5 +19,12 @@ namespace esphome
std::string bytes_to_hex(const std::vector<uint8_t> &data);
std::vector<uint8_t> hex_to_bytes(const std::string &hex);
void print_bits_8(uint8_t value);

// esphome optional did not work in tests and std::optional is not available in c++ 14.
template <typename T>
using opt = std::experimental::optional<T>;
using opt_null_t = std::experimental::nullopt_t;
constexpr auto nullopt = std::experimental::nullopt;

} // namespace samsung_ac
} // namespace esphome

0 comments on commit 85f0f57

Please sign in to comment.