sehaas / ha_hisense_tv

Hisense TV integration for Home Assistant
MIT License
100 stars 22 forks source link

Help with game mode #48

Closed tungmeister closed 1 year ago

tungmeister commented 1 year ago

@sehaas I'm trying to work out how to add a game mode switch to the integration but unfortunately my knowledge of python is very limited so I'm really struggling. Looking at MQTT explorer I need to send the below for on or off:

{
    "action":   "set_value",
    "menu_id":  122,
    "menu_value_type":  "int",
    "menu_value":   1
}

{
    "action":   "set_value",
    "menu_id":  122,
    "menu_value_type":  "int",
    "menu_value":   0
}

to the topic /remoteapp/tv/platform_service/%s/actions/picturesetting

I can also see the state of game mode is being shown in the sensor as GameModeEnable but I really can't work out how to modify the switch.py to include this switch.

I've been having a go here but I've no idea how I define the state of the switch based on that GameModeEnable value or how I would disable the switch when the projector isn't on (I have a Hisense projector).

Could you assist?

tungmeister commented 1 year ago

I've been messing some more and I've got it mostly functional - the switch works and disables/enables as expected. I can't work out how to make the switch appear under the initial device, I've only been able to hack it to appear under a separate *name* game mode device. I'm also struggling to parse the initial state.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 42 days with no activity. Remove stale label or comment or this will be closed in 7 days