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.2.0.tar.gz (18.3 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.2.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiosharp_cocoro_air-0.2.0.tar.gz
  • Upload date:
  • Size: 18.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 1870746d9f3292b45c2c7be175fad4301d782b7bb8017b42c43245945be42ced
MD5 d8e7689a03693823e512cb21fbba887d
BLAKE2b-256 d1c850732aafaaf132c35c881f747ca8be83a5c6995f980169b278cfd48ec753

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosharp_cocoro_air-0.2.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aiosharp_cocoro_air-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0027952f030e885309ccd0e8cb69b79760f07db62dde9608931e86063acf7600
MD5 ceb90927631768144a7b637f2f98bf71
BLAKE2b-256 0e4f31818486c29316e2667afcc074dda68eb651ac2efbae2ea0975021bb5da0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosharp_cocoro_air-0.2.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