Skip to content

Commit

Permalink
Fix issue with current color
Browse files Browse the repository at this point in the history
  • Loading branch information
nothans committed Oct 31, 2024
1 parent a618f55 commit 9f4891a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CheerLights Python Package
# CheerLights API Python Package

A Python package to interact with the CheerLights API. It allows users to get the current CheerLights color, retrieve the color history, and perform various color-related utilities.

Expand Down
2 changes: 1 addition & 1 deletion cheerlights_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cheerlights/__init__.py
# cheerlights_api/__init__.py

from .cheerlights_api import (
get_current_color,
Expand Down
7 changes: 4 additions & 3 deletions cheerlights_api/cheerlights_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cheerlights/cheerlights_api.py
# cheerlights_api/cheerlights_api.py

import requests

Expand All @@ -11,7 +11,8 @@ def get_current_color():
Returns:
dict: A dictionary with 'color' and 'hex' keys.
"""
response = requests.get(CHEERLIGHTS_FEED_URL)
url = f"{CHEERLIGHTS_FEED_URL}?results=1"
response = requests.get(url)
response.raise_for_status()
data = response.json()
color_name = data['feeds'][0]['field1']
Expand Down Expand Up @@ -45,7 +46,7 @@ def get_color_history(count=10):
Get the history of CheerLights colors.
Args:
count (int): The number of recent colors to retrieve.
count (int): The number of recent colors to retrieve (max 8000).
Returns:
list: A list of dictionaries with 'color', 'hex', and 'timestamp'.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='cheerlights_api',
version='0.1.1',
version='0.1.2',
description='A Python package to interact with the CheerLights API.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 9f4891a

Please sign in to comment.