Skip to content

Commit 9f4891a

Browse files
committed
Fix issue with current color
1 parent a618f55 commit 9f4891a

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CheerLights Python Package
1+
# CheerLights API Python Package
22

33
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.
44

cheerlights_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cheerlights/__init__.py
1+
# cheerlights_api/__init__.py
22

33
from .cheerlights_api import (
44
get_current_color,

cheerlights_api/cheerlights_api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cheerlights/cheerlights_api.py
1+
# cheerlights_api/cheerlights_api.py
22

33
import requests
44

@@ -11,7 +11,8 @@ def get_current_color():
1111
Returns:
1212
dict: A dictionary with 'color' and 'hex' keys.
1313
"""
14-
response = requests.get(CHEERLIGHTS_FEED_URL)
14+
url = f"{CHEERLIGHTS_FEED_URL}?results=1"
15+
response = requests.get(url)
1516
response.raise_for_status()
1617
data = response.json()
1718
color_name = data['feeds'][0]['field1']
@@ -45,7 +46,7 @@ def get_color_history(count=10):
4546
Get the history of CheerLights colors.
4647
4748
Args:
48-
count (int): The number of recent colors to retrieve.
49+
count (int): The number of recent colors to retrieve (max 8000).
4950
5051
Returns:
5152
list: A list of dictionaries with 'color', 'hex', and 'timestamp'.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name='cheerlights_api',
7-
version='0.1.1',
7+
version='0.1.2',
88
description='A Python package to interact with the CheerLights API.',
99
long_description=open('README.md').read(),
1010
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)