Python-xsense is a small library to interact with the API of XSense Home Security. It allows to retrieve the status of various devices and the basestation.
Example sync usage
>>> from xsense import XSense >>> from xsense.utils import dump_environment >>> api = XSense() >>> api.init() >>> api.login(username, password) >>> api.load_all() >>> for _, h in api.houses.items(): >>> for _, s in h.stations.items(): >>> api.get_state(s) >>> dump_environment(api)
Example async usage
>>> import asyncio >>> from xsense import AsyncXSense >>> from xsense.utils import dump_environment >>> >>> async def run(username: str, password: str): >>> api = AsyncXSense() >>> await api.init() >>> await api.login(username, password) >>> for _, h in api.houses.items(): >>> for _, s in h.stations.items(): >>> await api.get_state(s) >>> dump_environment(api) >>> >>> asyncio.run(run(username, password))
Development
This library is in an early development stage and created primarily to make an integration for home assistant.
Metadata
Release files for python-xsense 0.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_xsense-0.0.17-py3-none-any.whl | Python 3 | none | any | Details |
Release files / python_xsense-0.0.17-py3-none-any.whl
| Download URL | python_xsense-0.0.17-py3-none-any.whl |
|---|---|
| Size | 17.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
023e1a51b2d9b79fd696aa3648f535f407457b66ce6376734001b86510597298
|
|
BLAKE2b-256 checksum How to use checksums |
1b2ef57d673e9f14d460cad2e0462efb5c774dd9b89ca1c555ff11e38556524f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|