Skip to content

Commit

Permalink
include apps on screen
Browse files Browse the repository at this point in the history
  • Loading branch information
landonr committed Sep 25, 2023
1 parent 639aced commit fcd372f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions components/homeThing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ async def to_code(config):
menu_screen = await menu_screen_to_code(conf)
cg.add(menu.register_screen(menu_screen))

# if CONF_APPS in config:
# for app in config[CONF_APPS]:
# new_app = await cg.get_variable(app)
# cg.add(menu.register_app(new_app))
if CONF_APPS in config:
for app in config[CONF_APPS]:
new_app = await cg.get_variable(app)
cg.add(menu.register_app(new_app))

await battery_to_code(config, menu)
await ids_to_code(config, menu, MENU_IDS)
Expand Down
7 changes: 4 additions & 3 deletions components/homeThingAppCatToy/homeThingCatToyApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ void HomeThingCatToyApp::draw_app(
return;
}
auto largeFont = display_state_->get_font_large();
auto primaryTextColor = display_state_->primaryTextColor();
auto primaryTextColor =
display_state_->get_color_palette()->get_accent_primary();

auto color = Color(128, 0, 128);
auto color = display_state_->get_color_palette()->get_pink();
int yPos = display_buffer_->get_height() * 0.1;
display_buffer_->printf(display_buffer_->get_width() * 0.5, yPos, largeFont,
color, display::TextAlign::TOP_CENTER, "Cat Toy!");

color = Color(255, 50, 100);
color = display_state_->get_color_palette()->get_red();
display_buffer_->printf((display_buffer_->get_width() * 0.5) + 1, yPos + 1,
largeFont, color, display::TextAlign::TOP_CENTER,
"Cat Toy!");
Expand Down
10 changes: 7 additions & 3 deletions components/homeThingAppSnake/homeThingAppSnake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ void HomeThingAppSnake::draw_app(
int menuIndex,
const std::vector<homething_menu_base::MenuTitleBase*>* active_menu) {
active_tick();
auto snakeColor = display_state_->get_color_palette()->get_green();
for (auto segment : snake) {
draw_resized_pixel(segment.x, segment.y, Color(255, 255, 255));
draw_resized_pixel(segment.x, segment.y, snakeColor);
}
draw_resized_pixel(fruit_position_.x, fruit_position_.y, Color(255, 0, 0));
auto fruitColor = display_state_->get_color_palette()->get_red();
draw_resized_pixel(fruit_position_.x, fruit_position_.y, fruitColor);

auto borderColor = display_state_->get_color_palette()->get_accent_primary();
display_buffer_->rectangle(
margin, margin + display_state_->get_header_height(),
get_display_bounds().x * displayScale,
get_display_bounds().y * displayScale, Color(255, 255, 255));
get_display_bounds().y * displayScale, borderColor);
}

void HomeThingAppSnake::idleTick(int idleTime, int display_timeout) {}
Expand Down

0 comments on commit fcd372f

Please sign in to comment.