Skip to main content

XSense Python Module

Project description

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.

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

python-xsense-0.0.8.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

python_xsense-0.0.8-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file python-xsense-0.0.8.tar.gz.

File metadata

  • Download URL: python-xsense-0.0.8.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for python-xsense-0.0.8.tar.gz
Algorithm Hash digest
SHA256 3129b48869587ea2ebb56f2f13194309d5714aa3c91cdd47b7b67900537837e4
MD5 7923211c9b979de6b46327bda4e5a2c4
BLAKE2b-256 6a7abb9a4fec7834a961f054df590b9587fad5f6310303bd0cb0d3c900ce1acd

See more details on using hashes here.

File details

Details for the file python_xsense-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: python_xsense-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for python_xsense-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 eeb53d944d417221488ec048d6e5a38d433c0e9a45a7ef0228b2bf8b4c44a94f
MD5 dcd4e67ba0a08e9fa99f5aa10461d40a
BLAKE2b-256 5370e64b727633513b5692a37cdf2834612f22cf4845e05e654cf8f7986e9c4a

See more details on using hashes here.

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