Introduce dummy class to avoid nullpointer handling
This commit is contained in:
parent
ad1cc45768
commit
a35bb27d50
209
tw7100.cpp
209
tw7100.cpp
|
@ -1,4 +1,5 @@
|
|||
#include "tw7100.h"
|
||||
#include <deque>
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/defines.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
|
@ -220,70 +221,57 @@ void tw7100Component::update_sensor(std::pair<std::string, std::string> data) {
|
|||
int value = std::stoi(value_string);
|
||||
powered = (value > 0);
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
//if (powered_) powered_->publish_state(value > 0);
|
||||
powered_->publish_state(value > 0);
|
||||
#endif
|
||||
#ifdef USE_SWITCH
|
||||
if (power_switch_) power_switch_->publish_state(value > 0); // ack previous cmd or update switch
|
||||
power_switch_->publish_state(value > 0); // ack previous cmd or update switch
|
||||
#endif
|
||||
#ifdef USE_SENSOR
|
||||
if (power_status_) power_status_->publish_state(value);
|
||||
#endif
|
||||
power_status_->publish_state(value);
|
||||
} else if (cmd == "LAMP") {
|
||||
ESP_LOGV(TAG, "updating lamp sensors");
|
||||
#ifdef USE_SENSOR
|
||||
int value = std::stoi(value_string);
|
||||
if (lamp_hours_) lamp_hours_->publish_state(value);
|
||||
#endif
|
||||
lamp_hours_->publish_state(value);
|
||||
} else if (cmd == "SIGNAL") {
|
||||
ESP_LOGV(TAG, "updating signal sensors");
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
int value = std::stoi(value_string);
|
||||
if (has_signal_) has_signal_->publish_state(value > 0);
|
||||
#endif
|
||||
if (signal_status_) signal_status_->publish_state(value);
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
has_signal_->publish_state(value > 0);
|
||||
#endif
|
||||
#ifdef USE_SENSOR
|
||||
signal_status_->publish_state(value);
|
||||
#endif
|
||||
#ifdef USE_SELECT
|
||||
} else if (cmd == "LUMINANCE") {
|
||||
ESP_LOGV(TAG, "updating luminance sensors");
|
||||
#ifdef USE_SENSOR
|
||||
int value = std::stoi(value_string);
|
||||
if (luminance_level_) luminance_level_->publish_state(value);
|
||||
#endif
|
||||
#ifdef USE_SELECT
|
||||
if (luminance_select_) {
|
||||
if(tw7100Select::luminance.find(value_string) != tw7100Select::luminance.end()) {
|
||||
auto call = luminance_select_->make_call();
|
||||
call.set_option(tw7100Select::luminance[value_string]);
|
||||
call.perform();
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Result %s not present in options", value_string);
|
||||
}
|
||||
luminance_level_->publish_state(value);
|
||||
if(tw7100Select::luminance.find(value_string) != tw7100Select::luminance.end()) {
|
||||
auto call = luminance_select_->make_call();
|
||||
call.set_option(tw7100Select::luminance[value_string]);
|
||||
call.perform();
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Result %s not present in options", value_string);
|
||||
}
|
||||
#endif
|
||||
} else if (cmd == "SOURCE") {
|
||||
ESP_LOGV(TAG, "updating source select");
|
||||
#ifdef USE_SELECT
|
||||
if (source_select_) {
|
||||
if(tw7100Select::sources.find(value_string) != tw7100Select::sources.end()) {
|
||||
auto call = source_select_->make_call();
|
||||
call.set_option(tw7100Select::sources[value_string]);
|
||||
call.perform();
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Result %s not present in options", value_string);
|
||||
}
|
||||
if(tw7100Select::sources.find(value_string) != tw7100Select::sources.end()) {
|
||||
auto call = source_select_->make_call();
|
||||
call.set_option(tw7100Select::sources[value_string]);
|
||||
call.perform();
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Result %s not present in options", value_string);
|
||||
}
|
||||
#endif
|
||||
} else if (cmd == "ASPECT") {
|
||||
ESP_LOGV(TAG, "updating aspect select");
|
||||
#ifdef USE_SELECT
|
||||
if (aspect_select_) {
|
||||
if(tw7100Select::aspect.find(value_string) != tw7100Select::aspect.end()) {
|
||||
auto call = aspect_select_->make_call();
|
||||
call.set_option(tw7100Select::aspect[value_string]);
|
||||
call.perform();
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Result %s not present in options", value_string);
|
||||
}
|
||||
if(tw7100Select::aspect.find(value_string) != tw7100Select::aspect.end()) {
|
||||
auto call = aspect_select_->make_call();
|
||||
call.set_option(tw7100Select::aspect[value_string]);
|
||||
call.perform();
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Result %s not present in options", value_string);
|
||||
}
|
||||
#endif
|
||||
} else if (cmd == "OVSCAN") {
|
||||
ESP_LOGV(TAG, "updating ovscan select");
|
||||
} else if (cmd == "CMODE") {
|
||||
|
@ -302,204 +290,141 @@ void tw7100Component::update_sensor(std::pair<std::string, std::string> data) {
|
|||
ESP_LOGV(TAG, "updating msel select");
|
||||
} else if (cmd == "SPEED") {
|
||||
ESP_LOGV(TAG, "updating speed select");
|
||||
#ifdef USE_TEXT_SENSOR
|
||||
} else if (cmd == "SNO") {
|
||||
if (serial_ != nullptr) serial_->publish_state(value_string);
|
||||
serial_->publish_state(value_string);
|
||||
#endif
|
||||
#ifdef USE_SWITCH
|
||||
} else if (cmd == "BTAUDIO") {
|
||||
ESP_LOGV(TAG, "updating btaudio switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (btaudio_switch_) btaudio_switch_->publish_state(value > 0);
|
||||
#endif
|
||||
btaudio_switch_->publish_state(value > 0);
|
||||
} else if (cmd == "4KENHANCE") {
|
||||
ESP_LOGV(TAG, "updating 4kenhance switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (_4kenhance_switch_) _4kenhance_switch_->publish_state(value > 0);
|
||||
#endif
|
||||
_4kenhance_switch_->publish_state(value > 0);
|
||||
} else if (cmd == "IMGPROC") {
|
||||
ESP_LOGV(TAG, "updating imgproc switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (img_processing_switch_) img_processing_switch_->publish_state(value > 1);
|
||||
#endif
|
||||
img_processing_switch_->publish_state(value > 1);
|
||||
} else if (cmd == "AUDIOOUT") {
|
||||
ESP_LOGV(TAG, "updating audioout switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (audioout_switch_) audioout_switch_->publish_state(value == 11);
|
||||
#endif
|
||||
audioout_switch_->publish_state(value == 11);
|
||||
} else if (cmd == "HREVERSE") {
|
||||
ESP_LOGV(TAG, "updating hflip switch");
|
||||
#ifdef USE_SWITCH
|
||||
if (hflip_switch_) hflip_switch_->publish_state(value_string == "ON");
|
||||
#endif
|
||||
hflip_switch_->publish_state(value_string == "ON");
|
||||
} else if (cmd == "VREVERSE") {
|
||||
ESP_LOGV(TAG, "updating vflip switch");
|
||||
#ifdef USE_SWITCH
|
||||
if (vflip_switch_) vflip_switch_->publish_state(value_string == "ON");
|
||||
#endif
|
||||
vflip_switch_->publish_state(value_string == "ON");
|
||||
} else if (cmd == "ILLUM") {
|
||||
ESP_LOGV(TAG, "updating illumination switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (illumination_switch_) illumination_switch_->publish_state(value == 1);
|
||||
#endif
|
||||
illumination_switch_->publish_state(value == 1);
|
||||
} else if (cmd == "STANDBYCONF") {
|
||||
ESP_LOGV(TAG, "updating standbyconf switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (standbyconf_switch_) standbyconf_switch_->publish_state(value == 1);
|
||||
#endif
|
||||
standbyconf_switch_->publish_state(value == 1);
|
||||
} else if (cmd == "AUTOHOME") {
|
||||
ESP_LOGV(TAG, "updating autohome switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (autohome_switch_) autohome_switch_->publish_state(value == 1);
|
||||
#endif
|
||||
autohome_switch_->publish_state(value == 1);
|
||||
} else if (cmd == "WLPWR") {
|
||||
ESP_LOGV(TAG, "updating wlan power switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (wlan_power_switch_) wlan_power_switch_->publish_state(value == 1);
|
||||
#endif
|
||||
wlan_power_switch_->publish_state(value == 1);
|
||||
} else if (cmd == "LOGTO") {
|
||||
ESP_LOGV(TAG, "updating logto switch");
|
||||
#ifdef USE_SWITCH
|
||||
int value = std::stoi(value_string);
|
||||
if (logto_switch_) logto_switch_->publish_state(value == 1);
|
||||
#endif
|
||||
logto_switch_->publish_state(value == 1);
|
||||
} else if (cmd == "MUTE") {
|
||||
ESP_LOGV(TAG, "updating mute switch with value %s", value_string.c_str());
|
||||
#ifdef USE_SWITCH
|
||||
if (mute_switch_) mute_switch_->publish_state(value_string == "ON");
|
||||
mute_switch_->publish_state(value_string == "ON");
|
||||
#endif
|
||||
#ifdef USE_NUMBER
|
||||
} else if (cmd == "VOL") {
|
||||
ESP_LOGV(TAG, "updating volume number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (volume_number_) volume_number_->publish_state(value);
|
||||
#endif
|
||||
volume_number_->publish_state(value);
|
||||
} else if (cmd == "VKEYSTONE") {
|
||||
ESP_LOGV(TAG, "updating vkeystone number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (vkeystone_number_) vkeystone_number_->publish_state(value);
|
||||
#endif
|
||||
vkeystone_number_->publish_state(value);
|
||||
} else if (cmd == "HKEYSTONE") {
|
||||
ESP_LOGV(TAG, "updating hkeystone number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (hkeystone_number_) hkeystone_number_->publish_state(value);
|
||||
#endif
|
||||
hkeystone_number_->publish_state(value);
|
||||
} else if (cmd == "BRIGHT") {
|
||||
ESP_LOGV(TAG, "updating brightness number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (brightness_number_) brightness_number_->publish_state(value);
|
||||
#endif
|
||||
brightness_number_->publish_state(value);
|
||||
} else if (cmd == "CONTRAST") {
|
||||
ESP_LOGV(TAG, "updating contrast number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (contrast_number_) contrast_number_->publish_state(value);
|
||||
#endif
|
||||
contrast_number_->publish_state(value);
|
||||
} else if (cmd == "DENSITY") {
|
||||
ESP_LOGV(TAG, "updating density number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (density_number_) density_number_->publish_state(value);
|
||||
#endif
|
||||
density_number_->publish_state(value);
|
||||
} else if (cmd == "TINT") {
|
||||
ESP_LOGV(TAG, "updating tint number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (tint_number_) tint_number_->publish_state(value);
|
||||
#endif
|
||||
tint_number_->publish_state(value);
|
||||
} else if (cmd == "CTEMP") {
|
||||
ESP_LOGV(TAG, "updating ctemp number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (ctemp_number_) ctemp_number_->publish_state(value);
|
||||
#endif
|
||||
ctemp_number_->publish_state(value);
|
||||
} else if (cmd == "FCOLOR") {
|
||||
ESP_LOGV(TAG, "updating fcolor number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (fcolor_number_) fcolor_number_->publish_state(value);
|
||||
#endif
|
||||
fcolor_number_->publish_state(value);
|
||||
} else if (cmd == "NRS") {
|
||||
ESP_LOGV(TAG, "updating nrs number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (nrs_number_) nrs_number_->publish_state(value);
|
||||
#endif
|
||||
nrs_number_->publish_state(value);
|
||||
} else if (cmd == "MPEGNRS") {
|
||||
ESP_LOGV(TAG, "updating mpegngs number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (mpegnrs_number_) mpegnrs_number_->publish_state(value);
|
||||
#endif
|
||||
mpegnrs_number_->publish_state(value);
|
||||
} else if (cmd == "OFFSETR") {
|
||||
ESP_LOGV(TAG, "updating offsetr number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (offsetr_number_) offsetr_number_->publish_state(value);
|
||||
#endif
|
||||
offsetr_number_->publish_state(value);
|
||||
} else if (cmd == "OFFSETG") {
|
||||
ESP_LOGV(TAG, "updating offsetg number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (offsetg_number_) offsetg_number_->publish_state(value);
|
||||
#endif
|
||||
offsetg_number_->publish_state(value);
|
||||
} else if (cmd == "OFFSETB") {
|
||||
ESP_LOGV(TAG, "updating offsetb number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (offsetb_number_) offsetb_number_->publish_state(value);
|
||||
#endif
|
||||
offsetb_number_->publish_state(value);
|
||||
} else if (cmd == "GAINR") {
|
||||
ESP_LOGV(TAG, "updating gainr number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (gainr_number_) gainr_number_->publish_state(value);
|
||||
#endif
|
||||
gainr_number_->publish_state(value);
|
||||
} else if (cmd == "GAING") {
|
||||
ESP_LOGV(TAG, "updating gaing number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (gaing_number_) gaing_number_->publish_state(value);
|
||||
#endif
|
||||
gaing_number_->publish_state(value);
|
||||
} else if (cmd == "GAINB") {
|
||||
ESP_LOGV(TAG, "updating gainb number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (gainb_number_) gainb_number_->publish_state(value);
|
||||
#endif
|
||||
gainb_number_->publish_state(value);
|
||||
} else if (cmd == "SHRF") {
|
||||
ESP_LOGV(TAG, "updating shrf number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (shrf_number_) shrf_number_->publish_state(value);
|
||||
#endif
|
||||
shrf_number_->publish_state(value);
|
||||
} else if (cmd == "SHRS") {
|
||||
ESP_LOGV(TAG, "updating shrs number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (shrs_number_) shrs_number_->publish_state(value);
|
||||
#endif
|
||||
shrs_number_->publish_state(value);
|
||||
} else if (cmd == "DERANGE") {
|
||||
ESP_LOGV(TAG, "updating derange number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (derange_number_) derange_number_->publish_state(value);
|
||||
#endif
|
||||
derange_number_->publish_state(value);
|
||||
} else if (cmd == "DESTRENGTH") {
|
||||
ESP_LOGV(TAG, "updating destrength number with value %s", value_string.c_str());
|
||||
#ifdef USE_NUMBER
|
||||
int value = std::stoi(value_string);
|
||||
if (destrength_number_) destrength_number_->publish_state(value);
|
||||
destrength_number_->publish_state(value);
|
||||
#endif
|
||||
} else {
|
||||
ESP_LOGW(TAG, "Command %s unknown, skipping updating sensor with value", cmd.c_str());
|
||||
|
|
158
tw7100.h
158
tw7100.h
|
@ -1,8 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/entity_base.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/components/uart/uart.h"
|
||||
#include <map>
|
||||
|
||||
#ifdef USE_SENSOR
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
|
@ -18,6 +20,7 @@
|
|||
|
||||
#ifdef USE_SWITCH
|
||||
#include "esphome/components/switch/switch.h"
|
||||
#include "switch/tw7100_switch.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_SELECT
|
||||
|
@ -66,20 +69,20 @@ class tw7100Component : public PollingComponent, public uart::UARTDevice {
|
|||
void set_serial(text_sensor::TextSensor *serial) { this->serial_ = serial; }
|
||||
#endif
|
||||
#ifdef USE_SWITCH
|
||||
void set_set_pwr(switch_::Switch *switch_) { this->power_switch_ = switch_; }
|
||||
void set_set_btaudio(switch_::Switch *switch_) { this->btaudio_switch_ = switch_; }
|
||||
void set_set_mute(switch_::Switch *switch_) { this->mute_switch_ = switch_; }
|
||||
void set_set_wlpwr(switch_::Switch *switch_) { this->wlan_power_switch_ = switch_; }
|
||||
void set_set_autohome(switch_::Switch *switch_) { this->autohome_switch_ = switch_; }
|
||||
void set_set_product(switch_::Switch *switch_) { this->product_switch_ = switch_; }
|
||||
void set_set_standbyconf(switch_::Switch *switch_) { this->standbyconf_switch_ = switch_; }
|
||||
void set_set_illum(switch_::Switch *switch_) { this->illumination_switch_ = switch_; }
|
||||
void set_set_vreverse(switch_::Switch *switch_) { this->vflip_switch_ = switch_; }
|
||||
void set_set_hreverse(switch_::Switch *switch_) { this->hflip_switch_ = switch_; }
|
||||
void set_set_audioout(switch_::Switch *switch_) { this->audioout_switch_ = switch_; }
|
||||
void set_set_imgproc(switch_::Switch *switch_) { this->img_processing_switch_ = switch_; }
|
||||
void set_set_4kenhance(switch_::Switch *switch_) { this->_4kenhance_switch_ = switch_; }
|
||||
void set_set_logto(switch_::Switch *switch_) { this->logto_switch_ = switch_; }
|
||||
void set_set_pwr(tw7100::tw7100Switch *switch_) { this->power_switch_ = switch_; }
|
||||
void set_set_btaudio(tw7100::tw7100Switch *switch_) { this->btaudio_switch_ = switch_; }
|
||||
void set_set_mute(tw7100::tw7100Switch *switch_) { this->mute_switch_ = switch_; }
|
||||
void set_set_wlpwr(tw7100::tw7100Switch *switch_) { this->wlan_power_switch_ = switch_; }
|
||||
void set_set_autohome(tw7100::tw7100Switch *switch_) { this->autohome_switch_ = switch_; }
|
||||
void set_set_product(tw7100::tw7100Switch *switch_) { this->product_switch_ = switch_; }
|
||||
void set_set_standbyconf(tw7100::tw7100Switch *switch_) { this->standbyconf_switch_ = switch_; }
|
||||
void set_set_illum(tw7100::tw7100Switch *switch_) { this->illumination_switch_ = switch_; }
|
||||
void set_set_vreverse(tw7100::tw7100Switch *switch_) { this->vflip_switch_ = switch_; }
|
||||
void set_set_hreverse(tw7100::tw7100Switch *switch_) { this->hflip_switch_ = switch_; }
|
||||
void set_set_audioout(tw7100::tw7100Switch *switch_) { this->audioout_switch_ = switch_; }
|
||||
void set_set_imgproc(tw7100::tw7100Switch *switch_) { this->img_processing_switch_ = switch_; }
|
||||
void set_set_4kenhance(tw7100::tw7100Switch *switch_) { this->_4kenhance_switch_ = switch_; }
|
||||
void set_set_logto(tw7100::tw7100Switch *switch_) { this->logto_switch_ = switch_; }
|
||||
#endif
|
||||
#ifdef USE_SELECT
|
||||
void set_set_source(tw7100::tw7100Select *select_) { this->source_select_ = select_; }
|
||||
|
@ -119,73 +122,92 @@ class tw7100Component : public PollingComponent, public uart::UARTDevice {
|
|||
void set_set_destrength(tw7100::tw7100Number *number_) { this->destrength_number_ = number_; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
binary_sensor::BinarySensor *dummy_binary_sensor = new binary_sensor::BinarySensor();
|
||||
#endif
|
||||
#ifdef USE_SENSOR
|
||||
sensor::Sensor *dummy_sensor = new sensor::Sensor();
|
||||
#endif
|
||||
#ifdef USE_TEXT_SENSOR
|
||||
text_sensor::TextSensor *dummy_text_sensor = new text_sensor::TextSensor();
|
||||
#endif
|
||||
#ifdef USE_SWITCH
|
||||
tw7100::tw7100Switch *dummy_switch = new tw7100::tw7100Switch();
|
||||
#endif
|
||||
#ifdef USE_SELECT
|
||||
tw7100::tw7100Select *dummy_select = new tw7100::tw7100Select();
|
||||
#endif
|
||||
#ifdef USE_NUMBER
|
||||
tw7100::tw7100Number *dummy_number = new tw7100::tw7100Number();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
binary_sensor::BinarySensor *powered_{nullptr};
|
||||
binary_sensor::BinarySensor *has_signal_{nullptr};
|
||||
binary_sensor::BinarySensor *powered_ = dummy_binary_sensor;
|
||||
binary_sensor::BinarySensor *has_signal_ = dummy_binary_sensor;
|
||||
#endif
|
||||
#ifdef USE_SENSOR
|
||||
sensor::Sensor *lamp_hours_{nullptr};
|
||||
sensor::Sensor *power_status_{nullptr};
|
||||
sensor::Sensor *signal_status_{nullptr};
|
||||
sensor::Sensor *luminance_level_{nullptr};
|
||||
sensor::Sensor *lamp_hours_ = dummy_sensor;
|
||||
sensor::Sensor *power_status_ = dummy_sensor;
|
||||
sensor::Sensor *signal_status_ = dummy_sensor;
|
||||
sensor::Sensor *luminance_level_ = dummy_sensor;
|
||||
#endif
|
||||
#ifdef USE_TEXT_SENSOR
|
||||
text_sensor::TextSensor *serial_{nullptr};
|
||||
text_sensor::TextSensor *serial_ = dummy_text_sensor;
|
||||
#endif
|
||||
#ifdef USE_SWITCH
|
||||
switch_::Switch *power_switch_{nullptr};
|
||||
switch_::Switch *btaudio_switch_{nullptr};
|
||||
switch_::Switch *mute_switch_{nullptr};
|
||||
switch_::Switch *wlan_power_switch_{nullptr};
|
||||
switch_::Switch *autohome_switch_{nullptr};
|
||||
switch_::Switch *product_switch_{nullptr};
|
||||
switch_::Switch *standbyconf_switch_{nullptr};
|
||||
switch_::Switch *illumination_switch_{nullptr};
|
||||
switch_::Switch *vflip_switch_{nullptr};
|
||||
switch_::Switch *hflip_switch_{nullptr};
|
||||
switch_::Switch *audioout_switch_{nullptr};
|
||||
switch_::Switch *img_processing_switch_{nullptr};
|
||||
switch_::Switch *_4kenhance_switch_{nullptr};
|
||||
switch_::Switch *logto_switch_{nullptr};
|
||||
tw7100::tw7100Switch *power_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *btaudio_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *mute_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *wlan_power_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *autohome_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *product_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *standbyconf_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *illumination_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *vflip_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *hflip_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *audioout_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *img_processing_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *_4kenhance_switch_ = dummy_switch;
|
||||
tw7100::tw7100Switch *logto_switch_ = dummy_switch;
|
||||
#endif
|
||||
#ifdef USE_SELECT
|
||||
tw7100::tw7100Select *source_select_{nullptr};
|
||||
tw7100::tw7100Select *luminance_select_{nullptr};
|
||||
tw7100::tw7100Select *aspect_select_{nullptr};
|
||||
tw7100::tw7100Select *ovscan_select_{nullptr};
|
||||
tw7100::tw7100Select *cmode_select_{nullptr};
|
||||
tw7100::tw7100Select *gamma_select_{nullptr};
|
||||
tw7100::tw7100Select *imgpreset_select_{nullptr};
|
||||
tw7100::tw7100Select *mcfi_select_{nullptr};
|
||||
tw7100::tw7100Select *clrspace_select_{nullptr};
|
||||
tw7100::tw7100Select *dynrange_select_{nullptr};
|
||||
tw7100::tw7100Select *msel_select_{nullptr};
|
||||
tw7100::tw7100Select *speed_select_{nullptr};
|
||||
tw7100::tw7100Select *source_select_ = dummy_select;;
|
||||
tw7100::tw7100Select *luminance_select_ = dummy_select;
|
||||
tw7100::tw7100Select *aspect_select_ = dummy_select;
|
||||
tw7100::tw7100Select *ovscan_select_ = dummy_select;
|
||||
tw7100::tw7100Select *cmode_select_ = dummy_select;
|
||||
tw7100::tw7100Select *gamma_select_ = dummy_select;
|
||||
tw7100::tw7100Select *imgpreset_select_ = dummy_select;
|
||||
tw7100::tw7100Select *mcfi_select_ = dummy_select;
|
||||
tw7100::tw7100Select *clrspace_select_ = dummy_select;
|
||||
tw7100::tw7100Select *dynrange_select_ = dummy_select;
|
||||
tw7100::tw7100Select *msel_select_ = dummy_select;
|
||||
tw7100::tw7100Select *speed_select_ = dummy_select;
|
||||
#endif
|
||||
#ifdef USE_NUMBER
|
||||
tw7100::tw7100Number *volume_number_{nullptr};
|
||||
tw7100::tw7100Number *vkeystone_number_{nullptr};
|
||||
tw7100::tw7100Number *hkeystone_number_{nullptr};
|
||||
tw7100::tw7100Number *brightness_number_{nullptr};
|
||||
tw7100::tw7100Number *contrast_number_{nullptr};
|
||||
tw7100::tw7100Number *density_number_{nullptr};
|
||||
tw7100::tw7100Number *tint_number_{nullptr};
|
||||
tw7100::tw7100Number *ctemp_number_{nullptr};
|
||||
tw7100::tw7100Number *fcolor_number_{nullptr};
|
||||
tw7100::tw7100Number *nrs_number_{nullptr};
|
||||
tw7100::tw7100Number *mpegnrs_number_{nullptr};
|
||||
tw7100::tw7100Number *offsetr_number_{nullptr};
|
||||
tw7100::tw7100Number *offsetg_number_{nullptr};
|
||||
tw7100::tw7100Number *offsetb_number_{nullptr};
|
||||
tw7100::tw7100Number *gainr_number_{nullptr};
|
||||
tw7100::tw7100Number *gaing_number_{nullptr};
|
||||
tw7100::tw7100Number *gainb_number_{nullptr};
|
||||
tw7100::tw7100Number *shrf_number_{nullptr};
|
||||
tw7100::tw7100Number *shrs_number_{nullptr};
|
||||
tw7100::tw7100Number *derange_number_{nullptr};
|
||||
tw7100::tw7100Number *destrength_number_{nullptr};
|
||||
tw7100::tw7100Number *volume_number_ = dummy_number;
|
||||
tw7100::tw7100Number *vkeystone_number_ = dummy_number;
|
||||
tw7100::tw7100Number *hkeystone_number_ = dummy_number;
|
||||
tw7100::tw7100Number *brightness_number_ = dummy_number;
|
||||
tw7100::tw7100Number *contrast_number_ = dummy_number;
|
||||
tw7100::tw7100Number *density_number_ = dummy_number;
|
||||
tw7100::tw7100Number *tint_number_ = dummy_number;
|
||||
tw7100::tw7100Number *ctemp_number_ = dummy_number;
|
||||
tw7100::tw7100Number *fcolor_number_ = dummy_number;
|
||||
tw7100::tw7100Number *nrs_number_ = dummy_number;
|
||||
tw7100::tw7100Number *mpegnrs_number_ = dummy_number;
|
||||
tw7100::tw7100Number *offsetr_number_ = dummy_number;
|
||||
tw7100::tw7100Number *offsetg_number_ = dummy_number;
|
||||
tw7100::tw7100Number *offsetb_number_ = dummy_number;
|
||||
tw7100::tw7100Number *gainr_number_ = dummy_number;
|
||||
tw7100::tw7100Number *gaing_number_ = dummy_number;
|
||||
tw7100::tw7100Number *gainb_number_ = dummy_number;
|
||||
tw7100::tw7100Number *shrf_number_ = dummy_number;
|
||||
tw7100::tw7100Number *shrs_number_ = dummy_number;
|
||||
tw7100::tw7100Number *derange_number_ = dummy_number;
|
||||
tw7100::tw7100Number *destrength_number_ = dummy_number;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue