aiokef package¶
A module for asynchronously interacting with KEF wireless speakers.
- class aiokef.AsyncKefSpeaker(host: str, port: int = 50001, volume_step: float = 0.05, maximum_volume: float = 1.0, standby_time: Optional[int] = None, inverse_speaker_mode: bool = False, *, loop: Optional[AbstractEventLoop] = None)[source]¶
Bases:
object
Asynchronous KEF speaker class.
- Parameters:
host (str) – The IP of the speaker.
port (int, optional) – The port used for the communication, the default is 50001.
volume_step (float, optional) – The volume change when calling
increase_volume
ordecrease_volume
, by default 0.05.maximum_volume (float, optional) – The maximum allow volume, between 0 and 1. Use this to avoid accidentally setting very high volumes, by default 1.0.
loop (
asyncio.BaseEventLoop
, optional) – The eventloop to use.standby_time (int, optional) – Put the speaker in standby when inactive for
standby_time
minutes. The only options are None (default), 20, and 60.inverse_speaker_mode (bool, optional) – Reverse L/R to R/L.
- sync¶
Run any method that the
AsyncKefSpeaker
has in a synchronous way. For examplekef_speaker.sync.mute()
.- Type:
- async get_volume() Optional[float] [source]¶
Volume level of the media player (0..1). None if muted.
- async get_volume_and_is_muted(scale=True) Tuple[Union[float, int], bool] [source]¶
Return volume level (0..1) and is_muted (in a single call).
- async set_mode(desk_mode=None, wall_mode=None, phase_correction=None, high_pass=None, sub_polarity=None, bass_extension=None) None [source]¶
Set the mode of the speaker.
Leave option None to keep the setting the same.
- class aiokef.SyncKefSpeaker(async_speaker: AsyncKefSpeaker)[source]¶
Bases:
object
A synchronous KEF speaker class.
This has the same methods as
aiokef.AsyncKefSpeaker
, however, it wraps all async methods and call them in a blocking way.
Submodules¶
- aiokef.aiokef module
AsyncKefSpeaker
AsyncKefSpeaker.sync
AsyncKefSpeaker.decrease_volume()
AsyncKefSpeaker.get_desk_db()
AsyncKefSpeaker.get_high_hz()
AsyncKefSpeaker.get_low_hz()
AsyncKefSpeaker.get_mode()
AsyncKefSpeaker.get_play_pause()
AsyncKefSpeaker.get_source()
AsyncKefSpeaker.get_state()
AsyncKefSpeaker.get_sub_db()
AsyncKefSpeaker.get_treble_db()
AsyncKefSpeaker.get_volume()
AsyncKefSpeaker.get_volume_and_is_muted()
AsyncKefSpeaker.get_wall_db()
AsyncKefSpeaker.increase_volume()
AsyncKefSpeaker.is_muted()
AsyncKefSpeaker.is_on()
AsyncKefSpeaker.is_online()
AsyncKefSpeaker.mute()
AsyncKefSpeaker.next_track()
AsyncKefSpeaker.prev_track()
AsyncKefSpeaker.set_desk_db()
AsyncKefSpeaker.set_high_hz()
AsyncKefSpeaker.set_low_hz()
AsyncKefSpeaker.set_mode()
AsyncKefSpeaker.set_play_pause()
AsyncKefSpeaker.set_source()
AsyncKefSpeaker.set_sub_db()
AsyncKefSpeaker.set_treble_db()
AsyncKefSpeaker.set_volume()
AsyncKefSpeaker.set_wall_db()
AsyncKefSpeaker.turn_off()
AsyncKefSpeaker.turn_on()
AsyncKefSpeaker.unmute()
Mode
State
SyncKefSpeaker
arange()
bits_to_mode()
mode_to_bits()