Client for retrieving data from the La Crosse View cloud
Project description
La Crosse View
A library for retrieving data from La Crosse View-connected sensors.
Disclaimer
This library is NOT for the Jeelink LaCrosse sensors. You can find that library here. There is also a Home Assistant integration for the Jeelink LaCrosse sensors.
Installation
Run this in your terminal:
pip install lacrosse_view
Usage
This example shows how to get the latest data from every sensor connected to the first location on your account.
from lacrosse_view import LaCrosse
import asyncio
async def get_data():
api = LaCrosse()
# Log in to your LaCrosse View account
await api.login('paulus@home-assistant.io', 'password')
# Get the sensors from the first location on the account
locations = await api.get_locations()
sensors = await api.get_sensors(locations[0], tz="America/New_York", start=datetime.now() - timedelta(minutes=1), end=datetime.now())
for sensor in sensors:
for field in sensor.sensor_field_names:
# Each value is a dictionary with keys "s" and "u". "s" is the value and "u" is the Unix timestamp for it.
print(
f"{sensor.name} {field}: {sensor.data[field]["values"][-1]["s"]}"
)
await api.logout()
asyncio.run(get_data())
Questions?
If you have any questions, please, don't hesitate to open an issue.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lacrosse_view-0.0.2.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for lacrosse_view-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07717c128af440f8b1df23fdca19ec9becc5a5d6ba513e9c43bf757f67b8c1d5 |
|
MD5 | 1893abae47454d695e1ce9332157b878 |
|
BLAKE2b-256 | d70db949c2af478e4337ffeda814825abf7ce63e716ed1784d6654331f5925eb |