remove text_color

pull/2/head
LuBeDa 3 years ago
parent 2c727a451a
commit 6e6d39cfe4

@ -381,70 +381,6 @@ sensor:
---
#### Set (alarm/clock/gauge/text/today/weekday) color action
Sets the color of the selected element
##### Lambda set text color
```yaml
lamda:
id(rgb8x32)->set_text_color(200,45,12);
```
##### Action for set text color
You have to use use id of your ehmtx component, e.g. `rgb8x32`
```yaml
- ehmtx.***.color:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
```
valid elements:
- `ehmtx.alarm.color:`
- `ehmtx.clock.color:`
- `ehmtx.gauge.color:`
- `ehmtx.text.color:`
- `ehmtx.today.color:`
- `ehmtx.weekday.color:`
- ```red, green, blue```: the color components (`0..255`) *(default = `80`)*
---
#### Set screen color action
Sets the color of the **active** screen in the queue, so it's best to use it directly after add_screen.
##### Lambda for set_screen
```yaml
lamda:
id(rgb8x32)->set_screen_color("sun",200,45,12);
```
##### Action for set_screen
You have to use use id of your ehmtx component, e.g. `rgb8x32`
```yaml
- ehmtx.screen.color:
id: rgb8x32
icon_name: sun
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
```
- ```icon_name```: name of the actual icon/screen
- ```red, green, blue```: the color components (`0..255`) _(default = `80`)_
---
##### Show date
You can dynamically enable or disable the display of the date see parameter `show_date`.
@ -506,7 +442,6 @@ Experienced programmers can use this public methods:
void set_gauge_off();
void set_gauge_value(int v); // valid: 0 - 100 int because of register_service
void set_gauge_color(int r, int g, int b);
void set_text_color(int r, int g, int b);
void set_clock_color(int r, int g, int b);
void set_today_color(int r, int g, int b);
void set_weekday_color(int r, int g, int b);
@ -567,16 +502,6 @@ ehmtx:
ESP_LOGI("TriggerTest","Text: %s",y.c_str());
```
##### Change the text color like crazy
```yaml
ehmtx:
....
on_next_screen:
lambda: |-
id(rgb8x32)->set_text_color(rand() % 255, rand() % 255, rand() % 255);
```
##### Send an event to Home Assistant
To send data back to home assistant you can use events.
@ -843,8 +768,7 @@ These services are the same as the local services, so you can adapt the document
|`set_gauge_value`| {"percent"}|
|`set_gauge_off`|*none*|
|`set_alarm_color`| {"r", "g", "b"}|
|`set_text_color` | {"r", "g", "b"}|
|`set_clock_color`| {"r", "g", "b"}|
|`set_clock_color`| {"r", "g", "b"}|
|`set_today_color`| {"r", "g", "b"}|
|`set_gauge_color`| {"r", "g", "b"}|
|`set_weekday_color` |{"r", "g", "b"}|

@ -575,15 +575,6 @@ sensor:
#### Set (alarm/clock/gauge/text/today/weekday) color action
Sets the default color of the selected element
##### Lambda set text color
```yaml
lamda:
id(rgb8x32)->set_text_color(200,45,12);
```
##### Force screen
Force the selected [icon_screen](#icon-screen) ```icon_name``` to be displayed next. Afterwards the loop is continuing from this screen. e.g. helpfull for alarms. Or after an update of the value/text.

@ -81,12 +81,6 @@ namespace esphome
ESP_LOGD(TAG, "default clock color r: %d g: %d b: %d", r, g, b);
}
void EHMTX::set_text_color(int r, int g, int b)
{
this->text_color = Color((uint8_t)r & 248, (uint8_t)g & 252, (uint8_t)b & 248);
ESP_LOGD(TAG, "default text color r: %d g: %d b: %d", r, g, b);
}
bool EHMTX::string_has_ending(std::string const &fullString, std::string const &ending)
{
if (fullString.length() >= ending.length())
@ -172,7 +166,6 @@ namespace esphome
register_service(&EHMTX::show_alarm, "show_alarm", {"r", "g", "b","s"});
register_service(&EHMTX::show_indicator, "show_indicator", {"r", "g", "b","s"});
register_service(&EHMTX::set_text_color, "text_color", {"r", "g", "b"});
register_service(&EHMTX::set_clock_color, "clock_color", {"r", "g", "b"});
register_service(&EHMTX::set_today_color, "today_color", {"r", "g", "b"});
register_service(&EHMTX::set_weekday_color, "weekday_color", {"r", "g", "b"});

@ -126,7 +126,6 @@ namespace esphome
void set_time_format(std::string s);
void set_date_format(std::string s);
void show_indicator(int r=C_RED, int g=C_GREEN, int b=C_BLUE,int s=3);
void set_text_color(int r, int g, int b);
void set_clock_color(int r=C_RED, int g=C_GREEN, int b=C_BLUE);
void set_today_color(int r, int g, int b);
void set_weekday_color(int r, int g, int b);
@ -189,7 +188,6 @@ namespace esphome
bool del_slot(uint8_t _icon);
void hold_slot(uint8_t _sec);
void set_text(std::string text, uint8_t icon, uint16_t pixel, uint16_t et, uint16_t st);
void set_text_color(uint8_t icon_id,Color text_color);
};
class EHMTXNextScreenTrigger : public Trigger<std::string, std::string>

Loading…
Cancel
Save