Skip to main content

Access ambient light sensor on macOS

Project description

macals

Python module for accessing the ambient light sensor on macOS

Usage

Command Line

python -m macals

This will iterate all ambient light sensors and their lux values.

Python

from macals import list_sensors

for sensor in list_sensors:
    print(f'{sensor.name}: {sensor.get_current_lux()} lux')

There is likely only ever to be a single sensor, so macals.find_sensor() is probably fine to use, which just returns the first.

from macals import find_sensor

sensor = find_sensor()
print(f'{sensor.name}: {sensor.get_current_lux()} lux')

You can also just use the LightSensor class if you know the service name:

from macals import LightSensor

sensor = LightSensor('AppleSPUVD6286')
print(f'{sensor.name}: {sensor.get_current_lux()} lux')

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

macals-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distributions

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

macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl (7.6 kB view details)

Uploaded CPython 3.13macOS 15.0+ universal2 (ARM64, x86-64)

macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl (7.6 kB view details)

Uploaded CPython 3.12macOS 15.0+ universal2 (ARM64, x86-64)

macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl (7.6 kB view details)

Uploaded CPython 3.11macOS 15.0+ universal2 (ARM64, x86-64)

File details

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

File metadata

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

File hashes

Hashes for macals-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ce9972ef25cc175a8062d960774a9f7f61ed60c7b93d03b69b7df72f117f9232
MD5 e8a10419373ef31b8838f96762746b51
BLAKE2b-256 494112cc43dea5ae1ec1ef221c0e75fbfbdfee97f6bf512fc2ac3cc1c250b624

See more details on using hashes here.

Provenance

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

Publisher: build-and-publish.yml on sivel/macals

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

File details

Details for the file macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 46ba9a1b50b4db4080e1de103eabe6600082604ce705332e4d69af26922311e6
MD5 cddf94de3e6102c8c3ae6e8e5db1ece7
BLAKE2b-256 a50c4f999bf03575b0ab9d88c0befdc98444e8833fb970546014c9c1ee305868

See more details on using hashes here.

Provenance

The following attestation bundles were made for macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl:

Publisher: build-and-publish.yml on sivel/macals

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

File details

Details for the file macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 6884618084373e7e7874086237d12df8fff92b48f2bb353845502e9ea6bf0086
MD5 b82513597525bb356aba46ec05205496
BLAKE2b-256 278671ce9a42b4723be0433a756d6c31ba220126961f1b0d79d20243db0dcf12

See more details on using hashes here.

Provenance

The following attestation bundles were made for macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl:

Publisher: build-and-publish.yml on sivel/macals

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

File details

Details for the file macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 914ca9be419c64303931b09432e9851cec79164afa8fa8f932b46de6599e4268
MD5 395960b849647a91b8433567735d32e3
BLAKE2b-256 23e1695f87edac5ee53134719fa0ac4c9eb7e26cede6206dbb5662528a161cc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl:

Publisher: build-and-publish.yml on sivel/macals

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