Enable users select alignment for entity values (#753)
* Enable users select alignment for entity values Users will be able to select the alignment for the column with values on the entity pages. The options are: - Right (default) - Center - Left solves #732 * Add support to `xcen` on `set_entity`
This commit is contained in:
@@ -410,6 +410,7 @@ api:
|
||||
ent_icon: string
|
||||
ent_label: string
|
||||
ent_value: string
|
||||
ent_value_xcen: string
|
||||
then:
|
||||
- wait_until:
|
||||
binary_sensor.is_on: nextion_init
|
||||
@@ -417,12 +418,16 @@ api:
|
||||
// ESP_LOGD("nextion", "set entity %s", ent_id.c_str());
|
||||
std::string enticon = ent_id.c_str() + std::string("_pic");
|
||||
std::string entlabel = ent_id.c_str() + std::string("_label");
|
||||
std::string entxcen = ent_id.c_str() + std::string(".xcen=") + ent_value_xcen.c_str();
|
||||
id(disp1).set_component_text_printf(enticon.c_str(), "%s", ent_icon.c_str());
|
||||
if (strcmp(ent_icon.c_str(), "0") != 0) {
|
||||
id(disp1).set_component_text_printf(enticon.c_str(), "%s", ent_icon.c_str());
|
||||
}
|
||||
id(disp1).set_component_text_printf(entlabel.c_str(), "%s", ent_label.c_str());
|
||||
id(disp1).set_component_text_printf(ent_id.c_str(), "%s", ent_value.c_str());
|
||||
if (strcmp(ent_value_xcen.c_str(), "0") != 0) {
|
||||
id(disp1).send_command_printf("%s", entxcen.c_str());
|
||||
}
|
||||
|
||||
##### START - GLOBALS CONFIGURATION #####
|
||||
globals:
|
||||
|
||||
Reference in New Issue
Block a user