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.5.tar.gz (9.3 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.5-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-xsense-0.0.5.tar.gz
  • Upload date:
  • Size: 9.3 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.5.tar.gz
Algorithm Hash digest
SHA256 b39f0c192176e810be1d396d8ffe9c13ac9e780b543231bb766ef186938388e1
MD5 55d4da6892393b4f6e24ca4091eee397
BLAKE2b-256 ecafa67a44d762ed7d418ee21ecf4ed28c8b801e073fd2a0dcede9e2e9ff6dc8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_xsense-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.4 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b9a0c91e352b453672f2636e85806534df6b4dec7fe0f1e55a65ebc98dafaa92
MD5 0e2204f8556ac1b470901e277d6f2635
BLAKE2b-256 cd94afc50d1358d11eacd7acfe9700e36c3175d1b45e3f9f82224f3801d3c78f

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