Update cardputer.yaml

This commit is contained in:
void 2025-04-02 17:51:22 +00:00
parent 409878ab4e
commit c46b388716
1 changed files with 32 additions and 7 deletions

View File

@ -19,7 +19,7 @@ ota:
esp32_ble_tracker: esp32_ble_tracker:
scan_parameters: scan_parameters:
active: true active: False
wifi: wifi:
ssid: "DNTD" ssid: "DNTD"
@ -27,6 +27,7 @@ wifi:
fast_connect: True fast_connect: True
# Enable fallback hotspot (captive portal) in case wifi connection fails # Enable fallback hotspot (captive portal) in case wifi connection fails
ap: ap:
ssid: "M5Cardputer Fallback Hotspot" ssid: "M5Cardputer Fallback Hotspot"
@ -34,12 +35,32 @@ wifi:
captive_portal: captive_portal:
image:
- file: "media/m5.png"
type: RGB
id: my_image
transparency: alpha_channel
sensor:
- platform: homeassistant
id: temperature
entity_id: weather.home
attribute: temperature
internal: true
text_sensor: text_sensor:
# Current weather condition from Home Assistant # Current weather condition from Home Assistant
- platform: homeassistant - platform: homeassistant
id: mom_state id: mom_state
entity_id: person.mom # The entity_id for weather condition entity_id: person.mom # The entity_id for weather condition
internal: true internal: true
- platform: homeassistant
id: weather_condition
entity_id: weather.home # The entity_id for weather condition
internal: true
binary_sensor: binary_sensor:
- platform: gpio - platform: gpio
@ -103,7 +124,7 @@ output:
- platform: ledc - platform: ledc
pin: GPIO38 # Same pin as backlight pin: GPIO38 # Same pin as backlight
id: backlight_output id: backlight_output
frequency: 50 Hz frequency: 200 Hz
inverted: false inverted: false
light: light:
@ -181,14 +202,18 @@ display:
rotation: 90 rotation: 90
invert_colors: true invert_colors: true
lambda: |- lambda: |-
it.image(47, 50, id(my_image));
// Set background color to black for better contrast // Set background color to black for better contrast
Color text_color = id(color_white); // Set text color to white Color text_color = id(color_white); // Set text color to white
// Display the current time // Display the current time
it.strftime(49, 70, id(roboto_20), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(sntp_time).now()); it.strftime(49, 70, id(roboto_20), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(sntp_time).now());
// Print "NO U" at the top of the screen it.print(49, 76, id(roboto_20), text_color, "Your slut is at:");
it.print(49, 80, id(roboto_20), text_color, "Your slut is at:"); it.print(49, 90, id(roboto_20), text_color, id(mom_state).state.c_str());
// Display current weather condition
it.print(49, 110, id(roboto_20), text_color, id(mom_state).state.c_str()); it.print(49, 104, id(roboto_20), id(weather_condition).state.c_str());
// Display current temperature under the weather condition
String temp_str = "Temp: " + String(id(temperature).state) + " °F"; // Create the temperature string
it.print(49, 120, id(roboto_20), temp_str.c_str()); // Convert the String to a const char* and display it
font: font: