Skip to content

Commit

Permalink
Update package name
Browse files Browse the repository at this point in the history
  • Loading branch information
nothans committed Oct 31, 2024
1 parent 229486e commit 7a57bde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@ A Python package to interact with the CheerLights API. It allows users to get th
You can install the package using pip:

```bash
pip install cheerlights-api
pip install cheerlights_api
```

## Usage Examples

```python
import cheerlights-api
import cheerlights_api

# Get the current color name and hex code
current_color = cheerlights.get_current_color()
current_color = cheerlights_api.get_current_color()
print(current_color) # Example: {'color': 'red', 'hex': '#FF0000'}

# Get the current color name
color_name = cheerlights.get_current_color_name()
color_name = cheerlights_api.get_current_color_name()
print(color_name) # Example: 'red'

# Get the current hex code
hex_code = cheerlights.get_current_hex()
hex_code = cheerlights_api.get_current_hex()
print(hex_code) # Example: '#FF0000'

# Get the history of colors
history = cheerlights.get_color_history(5)
history = cheerlights_api.get_color_history(5)
for entry in history:
print(f"{entry['timestamp']}: {entry['color']} ({entry['hex']})")

# Convert a color name to hex
hex_code = cheerlights.color_name_to_hex('green')
hex_code = cheerlights_api.color_name_to_hex('green')
print(hex_code) # '#00FF00'

# Convert hex code to RGB
rgb = cheerlights.hex_to_rgb('#00FF00')
rgb = cheerlights_api.hex_to_rgb('#00FF00')
print(rgb) # (0, 255, 0)

# Check if a color is valid
is_valid = cheerlights.is_valid_color('purple')
is_valid = cheerlights_api.is_valid_color('purple')
print(is_valid) # True
```
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup, find_packages

setup(
name='cheerlights-api',
name='cheerlights_api',
version='0.1.0',
description='A Python package to interact with the CheerLights API.',
long_description=open('README.md').read(),
Expand Down

0 comments on commit 7a57bde

Please sign in to comment.