This pull request introduces a hardware abstraction layer for the clock display, refactors the word clock logic, and updates the main script to use these new abstractions. The major changes include the creation of a ClockDisplayHAL class, refactoring the WordClock class, and updating the main script and GIF handling to use these new classes.
Hardware Abstraction Layer:
src/clock_display_hal.py: Introduced the ClockDisplayHAL class to manage the LED matrix, including methods for displaying words, converting coordinates, setting pixels, and clearing the display.
Refactoring:
src/word_clock.py: Refactored the WordClock class to use the ClockDisplayHAL class for managing the LED matrix. This includes methods for highlighting words, getting minute words, and displaying the current time.
Main Script Updates:
src/main.py: Updated the main script to use ClockDisplayHAL and WordClock classes. Added argument parsing for pin, brightness, and GIF path.
GIF Handling:
src/gif.py: Refactored GIF handling functions to use the ClockDisplayHAL class for setting pixels and displaying GIFs.
This pull request introduces a hardware abstraction layer for the clock display, refactors the word clock logic, and updates the main script to use these new abstractions. The major changes include the creation of a
ClockDisplayHAL
class, refactoring theWordClock
class, and updating the main script and GIF handling to use these new classes.Hardware Abstraction Layer:
src/clock_display_hal.py
: Introduced theClockDisplayHAL
class to manage the LED matrix, including methods for displaying words, converting coordinates, setting pixels, and clearing the display.Refactoring:
src/word_clock.py
: Refactored theWordClock
class to use theClockDisplayHAL
class for managing the LED matrix. This includes methods for highlighting words, getting minute words, and displaying the current time.Main Script Updates:
src/main.py
: Updated the main script to useClockDisplayHAL
andWordClock
classes. Added argument parsing for pin, brightness, and GIF path.GIF Handling:
src/gif.py
: Refactored GIF handling functions to use theClockDisplayHAL
class for setting pixels and displaying GIFs.