small changes

This commit is contained in:
2021-07-17 18:10:25 +02:00
parent 7bcf3b6277
commit 4f7997568c
4 changed files with 5 additions and 35 deletions

View File

@@ -8,7 +8,6 @@ set(headers
feature_lamp.h
feature_switch.h
feature_tsl.h
futurecpp.h
myconfig.h
mymdns.h
mymqtt.h

View File

@@ -1,29 +0,0 @@
#pragma once
// system includes
#include <cstring>
#include <limits>
// C++20 backports (until espressif finally updates their aged compiler suite)
namespace std {
template <class To, class From>
typename std::enable_if_t<
sizeof(To) == sizeof(From) && std::is_trivially_copyable_v<From> && std::is_trivially_copyable_v<To>,
To>
// constexpr support needs compiler magic
bit_cast(const From& src) noexcept
{
static_assert(std::is_trivially_constructible_v<To>,
"This implementation additionally requires destination type to be trivially constructible");
To dst;
std::memcpy(&dst, &src, sizeof(To));
return dst;
}
template <typename EnumT, typename = std::enable_if_t<std::is_enum<EnumT>{}>>
constexpr std::underlying_type_t<EnumT> to_underlying(EnumT e) noexcept {
return static_cast<std::underlying_type_t<EnumT>>(e);
}
} // namespace std

View File

@@ -39,21 +39,21 @@ ConfigWrapper<bool> invert_switch{"invert_switch", "invert_switch", true};
ConfigWrapper<std::string> topic_switch_availability{"topic_switch_availability", "tpcswitchavaila", "dahoam/wohnzimmer/schalter1/available"};
ConfigWrapper<std::string> topic_switch_status{"topic_switch_status", "topicswitchstat", "dahoam/wohnzimmer/schalter1/status"};
ConfigWrapper<bool> enable_dht{"enable_dht", "enable_dht", true};
ConfigWrapper<bool> enable_dht{"enable_dht", "enable_dht", false};
ConfigWrapper<gpio_num_t> pins_dht{"pins_dht", "pins_dht", GPIO_NUM_33};
ConfigWrapper<std::string> topic_dht11_availability{"topic_dht11_availability", "tpcdht11availab", "dahoam/wohnzimmer/dht11_1/available"};
ConfigWrapper<std::string> topic_dht11_temperature{"topic_dht11_temperature", "tpcdht11tempera", "dahoam/wohnzimmer/dht11_1/temperature"};
ConfigWrapper<std::string> topic_dht11_humidity{"topic_dht11_humidity", "tpcdht11humidit", "dahoam/wohnzimmer/dht11_1/humidity"};
ConfigWrapper<bool> enable_i2c{"enable_i2c", "enable_i2c", true};
ConfigWrapper<bool> enable_i2c{"enable_i2c", "enable_i2c", false};
ConfigWrapper<gpio_num_t> pins_sda{"pins_sda", "pins_sda", GPIO_NUM_16};
ConfigWrapper<gpio_num_t> pins_scl{"pins_scl", "pins_scl", GPIO_NUM_17};
ConfigWrapper<bool> enable_tsl{"enable_tsl", "enable_tsl", true};
ConfigWrapper<bool> enable_tsl{"enable_tsl", "enable_tsl", false};
ConfigWrapper<std::string> topic_tsl2561_availability{"topic_tsl2561_availability", "tpctsl2561avail", "dahoam/wohnzimmer/tsl2561_1/available"};
ConfigWrapper<std::string> topic_tsl2561_lux{"topic_tsl2561_lux", "tpc_tsl2561_lux", "dahoam/wohnzimmer/tsl2561_1/lux"};
ConfigWrapper<bool> enable_bmp{"enable_bmp", "enable_bmp", true};
ConfigWrapper<bool> enable_bmp{"enable_bmp", "enable_bmp", false};
ConfigWrapper<std::string> topic_bmp085_availability{"topic_bmp085_availability", "topicbmp085avai", "dahoam/wohnzimmer/bmp085_1/available"};
ConfigWrapper<std::string> topic_bmp085_pressure{"topic_bmp085_pressure", "tpcbmp085pressu", "dahoam/wohnzimmer/bmp085_1/pressure"};
ConfigWrapper<std::string> topic_bmp085_temperature{"topic_bmp085_temperature", "tpcbmp085temper", "dahoam/wohnzimmer/bmp085_1/temperature"};