GithubHelp home page GithubHelp logo

Comments (5)

basnijholt avatar basnijholt commented on June 19, 2024 1

Check out https://www.home-assistant.io/integrations/kef/

from media_player.kef.

basnijholt avatar basnijholt commented on June 19, 2024 1

fbff670

from media_player.kef.

eugenet8k avatar eugenet8k commented on June 19, 2024

I found the following solution:

  1. Install aiokef directly into OS where HomeAssistant is running, because some dependencies are missing:
> pip3 install aiokef
  1. update media_player.py from this repo.

Replace

from custom_components.kef_custom.aiokef import (
    AsyncKefSpeaker,
    DSP_OPTION_MAPPING,
)

with

from aiokef import AsyncKefSpeaker

def arange(start, end, step):
    return [x * step for x in range(int(start / step), int(end / step) + 1)]

# DSP options
_DESK_WALL_DB_OPTIONS = arange(-6, 0, 0.5)
_TREBLE_DB_OPTIONS = arange(-2, 2, 0.5)
_HIGH_HZ_OPTIONS = arange(50, 120, 5)
_LOW_HZ_OPTIONS = arange(40, 250, 5)
_SUB_DB_OPTIONS = arange(-10, 10, 1)

DSP_OPTION_MAPPING = {
    "desk_db": _DESK_WALL_DB_OPTIONS,
    "wall_db": _DESK_WALL_DB_OPTIONS,
    "treble_db": _TREBLE_DB_OPTIONS,
    "high_hz": _HIGH_HZ_OPTIONS,
    "low_hz": _LOW_HZ_OPTIONS,
    "sub_db": _SUB_DB_OPTIONS,
}

And also, replace MediaPlayerDevice with MediaPlayerEntity, to avoid HASS warning of deprecation.

And also, replace ioloop into loop all over the file

    media_player = KefMediaPlayer(
        name,
        host,
        port,
        maximum_volume,
        volume_step,
        standby_time,
        inverse_speaker_mode,
        supports_on,
        sources,
        loop=hass.loop,
        unique_id=unique_id,
    )

That made it start with HASS, and I am able to control my KEF LSX. I guess I might just do a fork of this repo.

from media_player.kef.

eugenet8k avatar eugenet8k commented on June 19, 2024

@basnijholt oh, what the hell! I was searching for one and couldn't find anything... Truly blind I was! I guess it's not in the Integrations catalog yet.

from media_player.kef.

eugenet8k avatar eugenet8k commented on June 19, 2024

@basnijholt maybe, if that makes sense, it would be reasonable to have some top-level comment in this repo README.md. That this is a deprecated repo and we should just use the official HASS component. Thanks for pointing it out!

from media_player.kef.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.