Merge pull request #5442 from esphome/bump-2023.9.1

2023.9.1
This commit is contained in:
Jesse Hills 2023-09-28 13:05:04 +13:00 committed by GitHub
commit 9b75121337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -42,7 +42,12 @@ fi
mkdir -p "${pio_cache_base}" mkdir -p "${pio_cache_base}"
if bashio::fs.directory_exists '/config/esphome/.esphome'; then if bashio::fs.directory_exists '/config/esphome/.esphome'; then
bashio::log.info "Removing old .esphome directory..." bashio::log.info "Migrating old .esphome directory..."
if bashio::fs.file_exists '/config/esphome/.esphome/esphome.json'; then
mv /config/esphome/.esphome/esphome.json /data/esphome.json
fi
mkdir -p "/data/storage"
mv /config/esphome/.esphome/*.json /data/storage/ || true
rm -rf /config/esphome/.esphome rm -rf /config/esphome/.esphome
fi fi

View file

@ -10,7 +10,7 @@ void TuyaNumber::setup() {
this->parent_->register_listener(this->number_id_, [this](const TuyaDatapoint &datapoint) { this->parent_->register_listener(this->number_id_, [this](const TuyaDatapoint &datapoint) {
if (datapoint.type == TuyaDatapointType::INTEGER) { if (datapoint.type == TuyaDatapointType::INTEGER) {
ESP_LOGV(TAG, "MCU reported number %u is: %d", datapoint.id, datapoint.value_int); ESP_LOGV(TAG, "MCU reported number %u is: %d", datapoint.id, datapoint.value_int);
this->publish_state(datapoint.value_int); this->publish_state(datapoint.value_int * this->traits.get_step());
} else if (datapoint.type == TuyaDatapointType::ENUM) { } else if (datapoint.type == TuyaDatapointType::ENUM) {
ESP_LOGV(TAG, "MCU reported number %u is: %u", datapoint.id, datapoint.value_enum); ESP_LOGV(TAG, "MCU reported number %u is: %u", datapoint.id, datapoint.value_enum);
this->publish_state(datapoint.value_enum); this->publish_state(datapoint.value_enum);
@ -22,7 +22,8 @@ void TuyaNumber::setup() {
void TuyaNumber::control(float value) { void TuyaNumber::control(float value) {
ESP_LOGV(TAG, "Setting number %u: %f", this->number_id_, value); ESP_LOGV(TAG, "Setting number %u: %f", this->number_id_, value);
if (this->type_ == TuyaDatapointType::INTEGER) { if (this->type_ == TuyaDatapointType::INTEGER) {
this->parent_->set_integer_datapoint_value(this->number_id_, value); int integer_value = lround(value / this->traits.get_step());
this->parent_->set_integer_datapoint_value(this->number_id_, integer_value);
} else if (this->type_ == TuyaDatapointType::ENUM) { } else if (this->type_ == TuyaDatapointType::ENUM) {
this->parent_->set_enum_datapoint_value(this->number_id_, value); this->parent_->set_enum_datapoint_value(this->number_id_, value);
} }

View file

@ -1,6 +1,6 @@
"""Constants used by esphome.""" """Constants used by esphome."""
__version__ = "2023.9.0" __version__ = "2023.9.1"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_" ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
VALID_SUBSTITUTIONS_CHARACTERS = ( VALID_SUBSTITUTIONS_CHARACTERS = (