DTSW-7564-Add-Duckietown-Shell-billboards-to-the-Duckiematrix#126
Conversation
|
@liammcalpineduckietown how are the additional keys handled for existing databases? |
…d improving selection logic
3fa75e7 to
7f1dc08
Compare
They are handled by the Duckiematrix Renderer using the |
Yeah I would implement a earning to avoid it failing silently |
Not every billboard needs graphics or an end time. |
Yeah good point, I'm approving then. |
This pull request refactors the way billboards are selected and displayed in the
dt_shellshell. The main improvement is separating the logic for retrieving billboard names from the logic for selecting and displaying a billboard, making the code more modular and easier to maintain. Additionally, the process of selecting a billboard is now more explicit and relies on a weighted random selection based on priority.Billboard selection and display refactor:
get_billboard_names, which returns a weighted list of billboard names based on priority, andget_billboard, which selects a random billboard from this list and returns its content. [1] [2]__init__method to use the new methods for fetching billboard names and selecting a billboard, improving clarity and separation of concerns.get_billboard_namesto return an empty list when no billboards are available, instead ofNone, standardizing the output type.