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
name: CLOCK
pulse(num_pulses: int = 1) Clock[source]

Pulse the clock

relay: ClockRelay
sleep_time: float = 0.5
slow: int = 0
time_on_clock: int
class ClockRelay(*args, **kwargs)[source]

Bases: Protocol

Relay Protocol

pulse()[source]

pulse method

town_clock.clock.clock_tower module

town_clock.clock.pulses module

town_clock.clock.relay module

Module contents