Compare commits
3 Commits
04a77061ca
...
0abbd5ccf6
Author | SHA1 | Date | |
---|---|---|---|
0abbd5ccf6 | |||
5eb5d7ca44 | |||
b8a35f184e |
2
esphome/.gitignore
vendored
2
esphome/.gitignore
vendored
@ -9,3 +9,5 @@
|
|||||||
**/platformio.ini
|
**/platformio.ini
|
||||||
**/partitions.csv
|
**/partitions.csv
|
||||||
/secrets.yaml
|
/secrets.yaml
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
@ -133,6 +133,10 @@ text_sensor:
|
|||||||
format: "%H:%M"
|
format: "%H:%M"
|
||||||
internal: True
|
internal: True
|
||||||
|
|
||||||
|
- platform: homeassistant
|
||||||
|
entity_id: sensor.moon
|
||||||
|
id: moonphase
|
||||||
|
|
||||||
# Webserver configuration entry
|
# Webserver configuration entry
|
||||||
web_server:
|
web_server:
|
||||||
port: 80
|
port: 80
|
||||||
@ -315,6 +319,48 @@ display:
|
|||||||
it.print(50, 115, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "- hPa");
|
it.print(50, 115, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "- hPa");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Moon phase display */
|
||||||
|
if(id(moonphase).has_state()) {
|
||||||
|
int x = 526;
|
||||||
|
int y = 276;
|
||||||
|
if (id(moonphase).state == "new_moon") {
|
||||||
|
// new moon
|
||||||
|
it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("Moonphase", "new moon");
|
||||||
|
} else if (id(moonphase).state == "waxing_crescent") {
|
||||||
|
// waxing crescent
|
||||||
|
it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("Moonphase", "waxing crescent");
|
||||||
|
} else if (id(moonphase).state == "first_quarter") {
|
||||||
|
// first_quarter
|
||||||
|
it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("Moonphase", "first quarter");
|
||||||
|
} else if (id(moonphase).state == "waxing_gibbous") {
|
||||||
|
// waxing gibbous
|
||||||
|
it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("Moonphase", "waxing gibbous");
|
||||||
|
} else if (id(moonphase).state == "full_moon") {
|
||||||
|
// full moon
|
||||||
|
it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("Moonphase", "full moon");
|
||||||
|
} else if (id(moonphase).state == "waning_gibbous") {
|
||||||
|
// waning gibbous
|
||||||
|
it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("Moonphase", "waning gibbous");
|
||||||
|
} else if (id(moonphase).state == "last_quarter") {
|
||||||
|
// last quarter
|
||||||
|
it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("Moonphase", "last quarter");
|
||||||
|
} else if (id(moonphase).state == "waning_crescent") {
|
||||||
|
// waning crescent
|
||||||
|
it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("Moonphase", "waning crescent");
|
||||||
|
} else {
|
||||||
|
// N/A
|
||||||
|
ESP_LOGE("Moonphase", "No data");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* INSIDE */
|
/* INSIDE */
|
||||||
|
|
||||||
int offsetY = 137;
|
int offsetY = 137;
|
||||||
|
Loading…
Reference in New Issue
Block a user