Skip to main content

Async Python client for the Sharp COCORO Air EU cloud API

Project description

aiosharp-cocoro-air

Async Python client for the Sharp COCORO Air EU cloud API.

Designed as a standalone library for use by the Home Assistant core integration, but has no HA dependencies — pure Python + aiohttp.

Installation

pip install aiosharp-cocoro-air

Usage

import aiohttp
from aiosharp_cocoro_air import SharpCOCOROAir

async with SharpCOCOROAir(email, password) as client:
    await client.authenticate()
    devices = await client.get_devices()

    for device in devices:
        print(device.name, device.properties.temperature_c)

    await client.power_on(devices[0])
    await client.set_mode(devices[0], "auto")
    await client.set_humidify(devices[0], True)

When used inside Home Assistant, pass the shared session:

async with SharpCOCOROAir(email, password, session=hass_session) as client:
    ...

Supported Devices

Sharp air purifiers sold in Europe that use the Sharp COCORO Air EU cloud (the same backend as the official Sharp Life AIR EU mobile app).

Note: This library has only been tested with the Sharp KI-N52 air purifier. It should work with other Sharp COCORO Air EU devices, but this is unconfirmed. If you have a different model, please open an issue with your results.

API

SharpCOCOROAir(email, password, session=None)

  • authenticate() — Full login sequence (OAuth + terminal registration + box pairing)
  • get_devices() — Returns list[Device] with decoded sensor data
  • power_on(device) / power_off(device) — Power control
  • set_mode(device, mode) — Set operation mode (auto, night, pollen, silent, medium, high, ai_auto, realize)
  • set_humidify(device, on) — Toggle humidification

Models

  • Device — device identity, ECHONET addresses, and decoded properties
  • DeviceProperties — temperature, humidity, power, dust, smell, PCI sensor, filter usage, operation mode, etc.

Exceptions

  • SharpAuthError — authentication failed (bad credentials or expired session)
  • SharpConnectionError — network/connection error
  • SharpApiError — non-auth API error (4xx/5xx)

Development

pip install -e ".[dev]"
pytest tests/ -v
ruff check src/ tests/

License

MIT

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

aiosharp_cocoro_air-0.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

aiosharp_cocoro_air-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file aiosharp_cocoro_air-0.1.0.tar.gz.

File metadata

  • Download URL: aiosharp_cocoro_air-0.1.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aiosharp_cocoro_air-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c04a72a308fc51341e2efa64e069f3a574c05ccb7adfa0865e24d8bacb4fcf9c
MD5 e9ee458761b809234b19533b3e953655
BLAKE2b-256 f19df5450908bc239e9fd1572fae637c9cbc72ab2bc09177f0258970061edf09

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosharp_cocoro_air-0.1.0.tar.gz:

Publisher: publish.yml on rsokolowski/aiosharp-cocoro-air

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiosharp_cocoro_air-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aiosharp_cocoro_air-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63fe498d6c091d28d2c3f74a5ca26f745b2add7ecb680e11fff5c38a7aaedfd8
MD5 0f64064098be77852cea988d05931da8
BLAKE2b-256 31c5f9109b2fa0eccdbd0622b76fbf8ae302f8fafda95e49a9ae15dd4764db19

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosharp_cocoro_air-0.1.0-py3-none-any.whl:

Publisher: publish.yml on rsokolowski/aiosharp-cocoro-air

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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