mirror of
https://github.com/esphome/esphome.git
synced 2024-12-23 05:54:56 +01:00
commit
9b75121337
3 changed files with 10 additions and 4 deletions
|
@ -42,7 +42,12 @@ fi
|
|||
mkdir -p "${pio_cache_base}"
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ void TuyaNumber::setup() {
|
|||
this->parent_->register_listener(this->number_id_, [this](const TuyaDatapoint &datapoint) {
|
||||
if (datapoint.type == TuyaDatapointType::INTEGER) {
|
||||
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) {
|
||||
ESP_LOGV(TAG, "MCU reported number %u is: %u", datapoint.id, datapoint.value_enum);
|
||||
this->publish_state(datapoint.value_enum);
|
||||
|
@ -22,7 +22,8 @@ void TuyaNumber::setup() {
|
|||
void TuyaNumber::control(float value) {
|
||||
ESP_LOGV(TAG, "Setting number %u: %f", this->number_id_, value);
|
||||
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) {
|
||||
this->parent_->set_enum_datapoint_value(this->number_id_, value);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2023.9.0"
|
||||
__version__ = "2023.9.1"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||
|
|
Loading…
Reference in a new issue