diff --git a/number/tw7100_number.cpp b/number/tw7100_number.cpp index da5df5c..9efc580 100644 --- a/number/tw7100_number.cpp +++ b/number/tw7100_number.cpp @@ -26,7 +26,8 @@ void tw7100Number::control(float value) { std::string param; if (cmd_ == "VOL") { - ESP_LOGV(TAG, "VOL: "); + param = std::to_string((int)value); + ESP_LOGV(TAG, "VOL: %s (from %i)", param, (int)value); } if (param.length() > 0 && state != value) { diff --git a/tw7100.cpp b/tw7100.cpp index 4b18732..3bf5c62 100644 --- a/tw7100.cpp +++ b/tw7100.cpp @@ -64,8 +64,8 @@ std::vector pwr_on_query_cmds{ */ // // Sound settings -/* "VOL?", +/* "AUDIOOUT?", */ // @@ -247,8 +247,12 @@ void tw7100Component::update_sensor(std::pair data) { call.set_option(source_select_->sources[value_string]); call.perform(); } else if (cmd == "MUTE") { - ESP_LOGV(TAG, "updating mute switch with value %s", value_string); + ESP_LOGV(TAG, "updating mute switch with value %s", value_string.c_str()); mute_switch_->publish_state(value_string == "ON"); + } else if (cmd == "VOL") { + int value = std::stoi(value_string); + volume_number_->publish_state(value); + ESP_LOGV(TAG, "updating volume number with value %s", value_string.c_str()); } else { ESP_LOGW(TAG, "Command %s unknown, skipping updating sensor with value", cmd.c_str()); }