Skip to main content

A Python client for the HannaCloud API

Project description

HannaCloud Python Client

-- NOT OFFICIALLY SUPPORTED BY HANNA -- A Python client library for interacting with the HannaCloud API. This client provides methods for authentication and device data retrieval. Developped for the HannaCloud HomeAssistant integration.

Installation

You can install the package using pip:

pip install hanna-cloud

Usage

Here's a basic example of how to use the client:

from hanna_cloud import HannaCloudClient

# Initialize the client
client = HannaCloudClient()

# Authenticate with your email and password
access_token, refresh_token = client.authenticate(email="your-email", password="your-password")
print(f"Access token: {access_token}")

# Get devices
devices = client.GetDevices()
print(f"Devices: {devices}")

# Get user info
user_info = client.getUser()
print(f"User info: {user_info}")

# Get last device reading
last_reading = client.GetLastDeviceReading(device_id)
print(f"Last device reading: {last_reading}")

# Get device log history (example)
from datetime import datetime
log_history = client.getDeviceLogHistory(device_id=device_id)
print(f"Device log history: {log_history}")

Authentication

The client uses email and password authentication. Use the authenticate method to obtain and set the access token for subsequent requests.

API Methods

  • authenticate(email: str, password: str) -> (access_token, refresh_token)
  • GetDevices()
  • getUser()
  • GetLastDeviceReading(device_id: str)
  • getDeviceLogHistory(device_id: str)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hanna_cloud-0.0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hanna_cloud-0.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file hanna_cloud-0.0.1.tar.gz.

File metadata

  • Download URL: hanna_cloud-0.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for hanna_cloud-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6df975653d38caaa194e6f7e895429e3a075de8035a87fd4642b5520f77d0300
MD5 4f44c8201dae3d158858a44672de399b
BLAKE2b-256 cefb5ef32cd1b99775bff8a1c9a8f4e8464000364cd65c5ad99bf041ae1ccdad

See more details on using hashes here.

Provenance

The following attestation bundles were made for hanna_cloud-0.0.1.tar.gz:

Publisher: pypi.yml on bestycame/hanna_cloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hanna_cloud-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: hanna_cloud-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for hanna_cloud-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12284860447fc8dc61cf196004497483df2a7eacc472857b1e9fc96ff6182bc0
MD5 4f638ce07fa2dc1888f6a4446986d83c
BLAKE2b-256 64126f05f41f795a0ce64e897fd20989bd967136e0b21558436f0f9fe52d42dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for hanna_cloud-0.0.1-py3-none-any.whl:

Publisher: pypi.yml on bestycame/hanna_cloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page