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.15.tar.gz (13.1 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.15-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_xsense-0.0.15.tar.gz
  • Upload date:
  • Size: 13.1 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.15.tar.gz
Algorithm Hash digest
SHA256 f0f78db5c481ff8c97add6bb7d04e73147f60d92346903e637617b3101c338e5
MD5 ee8f7ca90ba037a8bba3b9b2c63e5d39
BLAKE2b-256 0080f226ce9171a3f9fbf02a046efaab5ca7d39d2c0c4ab0615062bba6b4e8ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_xsense-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 16.6 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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 7a2499b6ee393cac1ff78dad778729e38ef4d388a20f0c897823b84120d80b37
MD5 ccfda5e5020563bf46d0fb80afba04f3
BLAKE2b-256 81311d74a51c0dc4d2cff8e8609e3135d138b4fa3fdf345b147513e258d6b472

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