Welcome to Town Clock’s documentation!
Readme
Town Clock
Documentation
Current main: GitHub Pages
All versions: Read The Docs
Installation
Install Dev
pip install poetry
poetry install --with=dev
Install Docs
pip install poetry
poetry install --with=docs
Install for use
pip install . -e
Licence
town_clock
Subpackages
town_clock.clock package
Submodules
town_clock.clock.clock module
clock.py
- class Clock(name: CLOCK, relay: ClockRelay, time_on_clock: int, slow: int = 0, cutoff: int = 30, sleep_time: float = 0.5)[source]
Bases:
object
Class Clock
- Parameters:
name (
CLOCK
) – The name of the clock in enum form.relay (
ClockRelay
) – The relay that this Clock controls.time_on_clock (
int
) – minutes past 12 AM/PM (0-719)slow (
int
) – Minutes slow, fast is negative.cutoff (
int
) – Value is used to work out how long the clock will sleep for. Default is 30.
- compare(clock_time: int) Clock [source]
Compares the time on the clock with the given time and works out how slow or fast it is.
The ‘self.cutoff’ value is used to work out how long the clock will sleep for.
- Parameters:
clock_time – int: Time.clock_time, minutes after 12 AM/PM.
- Returns:
self
- cutoff: int = 30
- relay: ClockRelay
- sleep_time: float = 0.5
- slow: int = 0
- time_on_clock: int
town_clock.clock.clock_tower module
town_clock.clock.pulses module
town_clock.clock.relay module
Module contents
town_clock.ui package
Submodules
town_clock.ui.lcd_screen module
Module contents
town_clock.util package
Submodules
town_clock.util.clock_exceptions module
town_clock.util.clock_logging module
town_clock.util.location_sunrise_sunset module
Calculates sun position.
town_clock.util.utils module
- class CLOCK(value)[source]
Bases:
Enum
CLOCK Names A enum used for controlling and altering the clock times independently. todo: Use enum with objects..
- ALL = 0
- ONE = 1
- TWO = 2
- class Log_Level(value)[source]
Bases:
Enum
Log Levels: CRITICAL: 50 EXCEPTION = 40 ERROR: 40 WARNING: 30 INFO: 20 DEBUG: 10 NOTSET: 0
- CRITICAL = 50
- DEBUG = 10
- ERROR = 40
- EXCEPTION = 40
- INFO = 20
- NOTSET = 0
- PULSE = 45
- SUCCESS = 25
- WARNING = 30
Module contents
Utility package for town-clock
All modules can use these utility functions and classes.
Author: Zack Hankin Started: 27/01/2023
- class CLOCK(value)[source]
Bases:
Enum
CLOCK Names A enum used for controlling and altering the clock times independently. todo: Use enum with objects..
- ALL = 0
- ONE = 1
- TWO = 2
- class Log_Level(value)[source]
Bases:
Enum
Log Levels: CRITICAL: 50 EXCEPTION = 40 ERROR: 40 WARNING: 30 INFO: 20 DEBUG: 10 NOTSET: 0
- CRITICAL = 50
- DEBUG = 10
- ERROR = 40
- EXCEPTION = 40
- INFO = 20
- NOTSET = 0
- PULSE = 45
- SUCCESS = 25
- WARNING = 30
- class Mode(value)[source]
Bases:
Enum
Either Test or Active
DEV = ‘dev’ TEST = ‘test’ ACTIVE = ‘active’
- ACTIVE = 'active'
- DEV = 'dev'
- TEST = 'test'
- convert_position_string_to_number(position_str: str) float [source]
Converts a position string to a number.
- Parameters:
position_str – str: Position in the form of a string. eg “30.3402W”