Merge pull request #168 from philosowaffle/issue/167

[167] plex_lifx_color_theme throws when NumColors=1
This commit is contained in:
blacktwin 2019-06-15 09:26:31 -04:00 committed by GitHub
commit f2458c1089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,8 +51,8 @@ Duration = 3.0
# Number of colors to be used across your lights
NumColors = 5
# How closely the colors should match the media thumbnail, 10 is the highest
ColorQuality = 10
# How closely the colors should match the media thumbnail, 1 is the best match, larger numbers will perform faster but may be a less accurate color match
ColorQuality = 1
# Default theme to restore lights to on media pause/stop
DefaultPauseTheme = "Basic"
@ -246,7 +246,10 @@ if event == 'play' or event == "resume":
# Determine Color Palette for Lights
color_thief = ColorThief(thumb_path)
if num_colors >= 2:
palette = color_thief.get_palette(color_count=num_colors, quality=color_quality)
else:
palette = [color_thief.get_color(quality=color_quality)]
logger.debug("Color Palette: " + palette.__str__())
# Set Color Palette