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.16.tar.gz (13.0 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.16-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file python_xsense-0.0.16.tar.gz.

File metadata

  • Download URL: python_xsense-0.0.16.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for python_xsense-0.0.16.tar.gz
Algorithm Hash digest
SHA256 345a109d66877f00da55111190005cb68ad5cc90434f76b8d8d891425d57a1e8
MD5 b44a07081495035837bcd05cc307e553
BLAKE2b-256 fcb1824151d1188c44f89171f33161092edf76330bd9511688e5ee63dba6c04e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_xsense-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for python_xsense-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 cf2b3cd70fbaa925f6f42d355306202de3ef3c36ec537d1012687bcd0c4340b8
MD5 720b39ac69ffc7a51562c673ae3a8385
BLAKE2b-256 3ffb8d1970060f6f8ee08dd1b770f7f9609e99185155178e775a36578ef1439e

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