dcnielsen90 / python-bravia-tv

MIT License
13 stars 6 forks source link

Implement remote control platform #16

Closed Drafteed closed 3 years ago

Drafteed commented 3 years ago

Hello! Can you implement remote control platform for HA for sending remote keys? Such as: this or like this.

dcnielsen90 commented 3 years ago

This is definitely doable. It's 100% a feature add in Home Assistant. This library has all it needs to do this as is. (Send_command)

Drafteed commented 3 years ago

This is definitely doable. It's 100% a feature add in Home Assistant. This library has all it needs to do this as is. (Send_command)

I know :) I have already started developing this feature. And I have already made a first working version. But in the current implementation I don't like one thing: additional polling to get the is_on state.

There are two ways to solve this problem here:

  1. Store in BraviaRC current (last) power state value in property to use it in is_on (call methods not allowed here). This needs to be done in your repo.
  2. Refactor media_player to use an additional wrapper class that will be initialized to __init__.py and shared between several platforms. Like Apple TV integration do.

Currently i stuck. If you has the desire and motivation, feel free to contribute ;)

Drafteed commented 3 years ago

Please check this PR in core.