Skip to content

Commit

Permalink
Merge pull request #28 from Carunga/main
Browse files Browse the repository at this point in the history
Config examples
  • Loading branch information
landonr authored Nov 18, 2022
2 parents a775ed6 + eba57c4 commit 88260ae
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
- If you edit the font size you have to update both the font size and the corresponding font_size in Globals
3. Customize **Globals**

4. Update the **Custom Components** in the esphomeRemote/sharedRemoteConfig.yaml to match your config
4. Update the **Custom Components** in the esphomeRemote/sharedRemoteConfig.yaml to match your config, if you have difficulties looks at the [examples](sharedRemoteConfig-examples.md).
1. Every component is optional. If you don't want to include the component then remove it
2. Set your speaker media players under speaker_group_component
1. If you have a supported TV then update it otherwise remove the TV line
Expand Down
3 changes: 3 additions & 0 deletions esphomeRemote/esphomeRemotePlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ class BasePlayerComponent : public CustomAPIDevice, public Component {
} else if (strcmp(state.c_str(), "standby") == 0) {
playerState = PowerOffRemotePlayerState;
clearMedia();
} else if (strcmp(state.c_str(), "off") == 0) {
playerState = PowerOffRemotePlayerState;
clearMedia();
} else if (strcmp(state.c_str(), "home") == 0 || strcmp(state.c_str(), "Roku") == 0) {
playerState = StoppedRemotePlayerState;
clearMedia();
Expand Down
42 changes: 42 additions & 0 deletions sharedRemoteConfig-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<h1 align = "center">ESPHome Remote: config Examples </h1>

These are some configuration bits for common use cases that can be put in [sharedRemoteConfig.yaml](esphomeRemote/sharedRemoteConfig.yaml). It is C++-Code that is injected via the yml-File, so if you are not used to it pay attention to all the weird charackters (,{},"| spaces - they all do matter).

You should be able to replace the entire section with the example given below and simply adjust the names of your entities.

# without TV
to configure the remote without a TV but with smart speakers:

```
## Home assistant tv and media player
- lambda: |-
SpeakerSetup soundBar = SpeakerSetup("media_player.beam", "Beam");
std::vector<TVSetup> tvSetup = {};
std::vector<SpeakerSetup> speakerSetup = {
SpeakerSetup("media_player.kitchen", "Kitchen"),
SpeakerSetup("media_player.sofa", "Living room")
};
speakerGroup = new SonosSpeakerGroupComponent(displayUpdate);
speakerGroup->setup(tvSetup, speakerSetup);
return {speakerGroup};
id: speaker_group_component
```

# with TV but without soundbar
to configure the remote with a TV and with smart speakers but without a soundbar:

```
## Home assistant tv and media player
- lambda: |-
std::vector<TVSetup> tvSetup = {
TVSetup("media_player.your_smart_tv", "TV", NULL)
};
std::vector<SpeakerSetup> speakerSetup = {
SpeakerSetup("media_player.kitchen", "Kitchen"),
SpeakerSetup("media_player.sofa", "Living room")
};
speakerGroup = new SonosSpeakerGroupComponent(displayUpdate);
speakerGroup->setup(tvSetup, speakerSetup);
return {speakerGroup};
id: speaker_group_component
```

0 comments on commit 88260ae

Please sign in to comment.