Skip to content

Commit

Permalink
📝 add information
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezza34000 committed Dec 8, 2024
1 parent 0036e10 commit 2e00fed
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Petkit Api Client
# Petkit API Client

---

# WIP - UNDER DEVELOPMENT

---

[![PyPI](https://img.shields.io/pypi/v/pypetkitapi.svg)][pypi_]
[![Python Version](https://img.shields.io/pypi/pyversions/pypetkitapi)][python version]
Expand Down Expand Up @@ -37,16 +43,35 @@ Install the library using pip:
pip install pypetkitapi
```

## Usage:
## Usage Example:

```python
from petkit import PetKitClient

# Create a new PetKitClient instance
client = PetKitClient()

# Login to the PetKit API
client.login('username', 'password', 'region', 'timezone')
import asyncio
import logging
from pypetkit.client import PetKitClient

logging.basicConfig(level=logging.DEBUG)

async def main():
client = PetKitClient(
username="username", # Your PetKit account username
password="password", # Your PetKit account password
region="France", # Your region
timezone="Europe/Paris", # Your timezone
)

# To get the account and devices data attached to the account
await client.get_devices_data()
# Read the account data
print(client.account_data)
# Read the devices data
print(client.device_list)

# To send command the devices
await client.control_device("device", "command", "params")

if __name__ == "__main__":
asyncio.run(main())
```

## Contributing
Expand Down

0 comments on commit 2e00fed

Please sign in to comment.