Caldin-Maldin

экраны трамвая

Jun 6th, 2025 (edited)
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1.  
  2. script:
  3. - id: clock_date
  4. then:
  5. lambda: |-
  6. id(rgb8x32)->set_display_on(); // включение экрана
  7. id(rgb8x32)->set_brightness(222);
  8. id(rgb8x32)->set_adv_clock_color(224,255,255, 224,255,255, 105,105,105); // цвет часов, минут и разделителя
  9. id(rgb8x32)->set_show_day_of_week(true); // включение полоски с днями
  10. id(rgb8x32)->icon_clock("calendar|day#2", 1440, 50, true); // часы с календарём
  11. id(rgb8x32)->set_infotext_color(0,0,0, 0,0,0, true, 1); // цвет даты, шрифт и офсет
  12. id(rgb8x32)->expand_icon_to_9(3);
  13. id(rgb8x32)->set_calendar_color(255,0,0); // цвет верха календаря
  14. id(rgb8x32)->set_weekday_accent_on();
  15. id(rgb8x32)->set_weekday_color(80, 80, 80); // цвет полоски с днями
  16.  
  17.  
  18. if (id(net_time).now().day_of_week == 7 || id(net_time).now().day_of_week == 1 ) {
  19. id(rgb8x32)->set_today_color(255,0,0); // цвет текущего дня в полоске снизу
  20. }
  21. else {
  22. id(rgb8x32)->set_today_color(0,255,255); // цвет текущего дня в полоске снизу
  23. }
  24.  
  25. if (id(template_temperature_yard).state >= 20) {
  26. id(rgb8x32)->icon_text_screen("temperature", id(string_temperature_yard).state, 1440, 10, false, 255, 0, 0); // экран с температурой
  27. }
  28. else {
  29. id(rgb8x32)->icon_text_screen("temperature", id(string_temperature_yard).state, 1440, 10, false, 0, 255, 0); // экран с температурой
  30. }
  31.  
  32.  
  33. - id: only_clock
  34. then:
  35. lambda: |-
  36. id(rgb8x32)->set_display_on(); // включение экрана
  37. id(rgb8x32)->set_brightness(40); // яркость экрана
  38. id(rgb8x32)->set_adv_clock_color(224,255,255, 224,255,255, 105, 105, 105); // цвет часов, минут и разделителя
  39. id(rgb8x32)->set_show_day_of_week(false);
  40. id(rgb8x32)->clock_screen(1440, 50, false); // часы
  41.  
  42. if (id(template_temperature_yard).state >= 20) {
  43. id(rgb8x32)->icon_text_screen("temperature", id(string_temperature_yard).state, 1440, 10, false, 255, 0, 0); // экран с температурой
  44. }
  45. else {
  46. id(rgb8x32)->icon_text_screen("temperature", id(string_temperature_yard).state, 1440, 10, false, 0, 255, 0); // экран с температурой
  47. }
Advertisement
Add Comment
Please, Sign In to add comment