Skip to main content

A python implementation to interface Kef speakers over tcp/ip

Project description

Python interface to control KEF speakers

Supported: KEF LS50 Wireless

Untested: KEF LSX

Features supported

  • Get and set volume
  • Get and set source input
  • Get if the speakers are online
  • Automatically connects and disconnects when speakers goes online/offline

Examples

Setup:

host = '192.168.1.200'
port = 50001
speaker = KefSpeaker(host, port)

Set volume:

speaker.volume = 0.5 # %50 vol

Get volume:

volume = speaker.volume

Set source:

speaker.source = InputSource.AUX

Get source:

source = speaker.source

Mute:

speaker.volume = None
# Or
speaker.muted = True

Unmute (set to volume before mute):

speaker.muted = False

Step volume up

speaker.increseVolume() # 5% increase
speaker.increseVolume(0.10) # 10% increase

Step volume down

speaker.decreaseVolume() # 5% increase
speaker.decreaseVolume(0.10) # 10% increase

Turn off

speaker.turnOff()

How to

Upload new release:

  1. Update needed tools:
python3 -m pip install --user --upgrade setuptools wheel
  1. Build
python3 setup.py sdist bdist_wheel
  1. Upload
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

License

MIT License

Authors

  • Robin Grönberg

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

pykef-1.0.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

pykef-1.0.0-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page