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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce9972ef25cc175a8062d960774a9f7f61ed60c7b93d03b69b7df72f117f9232
|
|
| MD5 |
e8a10419373ef31b8838f96762746b51
|
|
| BLAKE2b-256 |
494112cc43dea5ae1ec1ef221c0e75fbfbdfee97f6bf512fc2ac3cc1c250b624
|
Provenance
The following attestation bundles were made for macals-0.1.0.tar.gz:
Publisher:
build-and-publish.yml on sivel/macals
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
macals-0.1.0.tar.gz -
Subject digest:
ce9972ef25cc175a8062d960774a9f7f61ed60c7b93d03b69b7df72f117f9232 - Sigstore transparency entry: 224000070
- Sigstore integration time:
-
Permalink:
sivel/macals@12377e6b93218979bdc72465e56b09b655e0d364 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sivel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@12377e6b93218979bdc72465e56b09b655e0d364 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl.
File metadata
- Download URL: macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl
- Upload date:
- Size: 7.6 kB
- Tags: CPython 3.13, macOS 15.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46ba9a1b50b4db4080e1de103eabe6600082604ce705332e4d69af26922311e6
|
|
| MD5 |
cddf94de3e6102c8c3ae6e8e5db1ece7
|
|
| BLAKE2b-256 |
a50c4f999bf03575b0ab9d88c0befdc98444e8833fb970546014c9c1ee305868
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl -
Subject digest:
46ba9a1b50b4db4080e1de103eabe6600082604ce705332e4d69af26922311e6 - Sigstore transparency entry: 224000096
- Sigstore integration time:
-
Permalink:
sivel/macals@12377e6b93218979bdc72465e56b09b655e0d364 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sivel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@12377e6b93218979bdc72465e56b09b655e0d364 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl.
File metadata
- Download URL: macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl
- Upload date:
- Size: 7.6 kB
- Tags: CPython 3.12, macOS 15.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6884618084373e7e7874086237d12df8fff92b48f2bb353845502e9ea6bf0086
|
|
| MD5 |
b82513597525bb356aba46ec05205496
|
|
| BLAKE2b-256 |
278671ce9a42b4723be0433a756d6c31ba220126961f1b0d79d20243db0dcf12
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl -
Subject digest:
6884618084373e7e7874086237d12df8fff92b48f2bb353845502e9ea6bf0086 - Sigstore transparency entry: 224000086
- Sigstore integration time:
-
Permalink:
sivel/macals@12377e6b93218979bdc72465e56b09b655e0d364 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sivel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@12377e6b93218979bdc72465e56b09b655e0d364 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl.
File metadata
- Download URL: macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl
- Upload date:
- Size: 7.6 kB
- Tags: CPython 3.11, macOS 15.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
914ca9be419c64303931b09432e9851cec79164afa8fa8f932b46de6599e4268
|
|
| MD5 |
395960b849647a91b8433567735d32e3
|
|
| BLAKE2b-256 |
23e1695f87edac5ee53134719fa0ac4c9eb7e26cede6206dbb5662528a161cc3
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl -
Subject digest:
914ca9be419c64303931b09432e9851cec79164afa8fa8f932b46de6599e4268 - Sigstore transparency entry: 224000107
- Sigstore integration time:
-
Permalink:
sivel/macals@12377e6b93218979bdc72465e56b09b655e0d364 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sivel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@12377e6b93218979bdc72465e56b09b655e0d364 -
Trigger Event:
workflow_dispatch
-
Statement type: