-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set LED pin in config, set animation in config, sleep timer fix, ping function #164
base: develop
Are you sure you want to change the base?
Conversation
…rent wirings, implemented davids_wiring
changed led_pin = 18, as it is the documented pin
# Conflicts: # wordclock_config/wordclock_config.example.cfg
|
||
def setBrightness(self, brightness): | ||
# def setBrightness(self, brightness): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve
@@ -22,15 +22,20 @@ developer_mode = False | |||
language = german | |||
|
|||
# Choose wiring layout here. Options are: bernds_wiring, christians_wiring, ... (possibly you need your own wiring layout) | |||
wiring_layout = bernds_wiring | |||
wiring_layout = davids_wiring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reset to default value (bernds_wiring is part of the docs on how to build the hardware and therefore widely used).
|
||
# Fonts available at /usr/share/fonts/... (e.g. some types listed in truetype/freefont) | ||
# FreeMono FreeMonoBoldOblique FreeSans FreeSansBoldOblique FreeSerif FreeSerifBoldItalic | ||
# FreeMonoBold FreeMonoOblique FreeSansBold FreeSansOblique FreeSerifBold FreeSerifItalic | ||
default_font = wcfont | ||
|
||
# Set the brightness of the display (between 1 and 255) | ||
brightness = 200 | ||
brightness = 255 | ||
use_brightness_sensor = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set default value to "False"
# animate new time with typewriter animation | ||
typewriter = false | ||
typewriter_speed = 10 | ||
# animate new time. Options: no_animation, typewriter, fadeOutIn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Implementation wasn't properly updated to a (hopefully growing) number of animations so far.
|
||
[ping_checker] | ||
# ping device IPs to check if somebody home, if not turn off brightness | ||
activate = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please deactivate by default.
self.animation = "typewriter" if self.typewriter else "fadeOutIn" | ||
if not any([self.animation == animation_type for animation_type in ['typewriter', 'fadeOutIn']]): | ||
self.animation = None | ||
# self.animation = "typewriter" if self.animation else "fadeOutIn" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented code. Overall, however, a very nice improvement!
self.ping_activated = config.getboolean('ping_checker', 'activate') | ||
except: | ||
print('Do not ping devices.') | ||
self.ping_activated = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set to False, if ping_checker is not set...
try: | ||
self.ping_activated = config.getboolean('ping_checker', 'activate') | ||
except: | ||
print('Do not ping devices.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use logging.info(...)
self.LED_PIN = config.getint('wordclock_display', 'led_pin') # GPIO pin connected to the pixels (must support PWM!). | ||
except: | ||
# For backward compatibility | ||
self.LED_PIN = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set to 18, in order to be backward compatible
Hi @davidsalb, thanks for opening the PR. Please take a look a the review and consider according changes. Best, |
Hi,
maybe the things I've done or parts of it are useful. The contribution consists of four commits:
-1. In the config-file the time settings had inline comments which messed with the readout of the parameters. I changed the descriptive comments to be one line above the time-parameters.
-2. The actual decision making to activate sleep mode wasn't working. I changed it and it works for me (also skipping the sleep cycle works)
shut_off_duration
) has passed without successful ping, the brightness is set to 0 to save energy. The activation of the ping_function, the IP's of the devices to be pinged and theshut_off_duration
are set in the configuration file.