Unverified Commit 5477d835 authored by Vassilis Panos's avatar Vassilis Panos Committed by GitHub
Browse files

Merge pull request #190 from smartHomeHub/rc

1.7.0
parents 7e282a6f 3e7100b7
Loading
Loading
Loading
Loading
+318 −0

File added.

Preview size limit exceeded, changes collapsed.

+172 −0

File added.

Preview size limit exceeded, changes collapsed.

+10 −1
Original line number Diff line number Diff line
@@ -27,13 +27,15 @@ CONF_UNIQUE_ID = 'unique_id'
CONF_DEVICE_CODE = 'device_code'
CONF_CONTROLLER_DATA = "controller_data"
CONF_POWER_SENSOR = 'power_sensor'
CONF_SOURCE_NAMES = 'source_names'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_UNIQUE_ID): cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
    vol.Required(CONF_DEVICE_CODE): cv.positive_int,
    vol.Required(CONF_CONTROLLER_DATA): cv.string,
    vol.Optional(CONF_POWER_SENSOR): cv.entity_id
    vol.Optional(CONF_POWER_SENSOR): cv.entity_id,
    vol.Optional(CONF_SOURCE_NAMES): dict
})

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
@@ -119,6 +121,13 @@ class SmartIRMediaPlayer(MediaPlayerDevice, RestoreEntity):
        if 'sources' in self._commands and self._commands['sources'] is not None:
            self._support_flags = self._support_flags | SUPPORT_SELECT_SOURCE

            for source, new_name in config.get(CONF_SOURCE_NAMES, {}).items():
                if source in self._commands['sources']:
                    if new_name is not None:
                        self._commands['sources'][new_name] = self._commands['sources'][source]

                    del self._commands['sources'][source]

            #Sources list
            for key in self._commands['sources']:
                self._sources_list.append(key)
+7 −1
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ Below are the code files created by the people in the community. Before you star
| ------------- | -------------------------- | ------------- |
[1120](../codes/climate/1120.json)|MSZ-GL25VGD<br>MSZ-GL35VGD<br>MSZ-GL42VGD<br>MSZ-GL50VG<br>MSZ-GL60VGD<br>MSZ-GL71VGD<br>MSZ-GL80VGD|Broadlink
[1121](../codes/climate/1121.json)|MSZ-GA35VA|Broadlink
[1122](../codes/climate/1122.json)|MSZ-AP50VGKD|Broadlink

#### Actron
| Code | Supported Models | Controller |
@@ -314,3 +315,8 @@ Below are the code files created by the people in the community. Before you star
| Code | Supported Models | Controller |
| ------------- | -------------------------- | ------------- |
[1840](../codes/climate/1840.json)|KFR-45GW/JNV<br>KFR-45G/JNV|Broadlink

#### Simbio
| Code | Supported Models | Controller |
| ------------- | -------------------------- | ------------- |
[1860](../codes/climate/1860.json)|Unknown|Broadlink
 No newline at end of file
+17 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ Find your device's brand code [here](MEDIA_PLAYER.md#available-codes-for-tv-devi
**device_code** (Required): ...... (Accepts only positive numbers)<br />
**controller_data** (Required): The data required for the controller to function. Enter the IP address of the Broadlink device **(must be an already configured device)**, or the entity id of the Xiaomi IR controller, or the MQTT topic on which to send commands.<br />
**power_sensor** (Optional): *entity_id* for a sensor that monitors whether your device is actually On or Off. This may be a power monitor sensor. (Accepts only on/off states)<br />
**source_names** (Optional): Override the names of sources as displayed in HomeAssistant (see below)<br />

## Example (using broadlink controller):
```yaml
@@ -61,6 +62,22 @@ media_player:
    power_sensor: binary_sensor.tv_power
```

### Overriding Source Names
Source names in device files are usually set to the name that the media player uses. These often aren't very descriptive, so you can override these names in the configuration file. You can also remove a source by setting its name to `null`

```yaml
media_player:
  - platform: smartir
    name: Living room TV
    unique_id: living_room_tv
    device_code: 1000
    controller_data: 192.168.10.10
    source_names:
      HDMI1: DVD Player
      HDMI2: Xbox
      VGA: null
```

## Available codes for TV devices:
Below are the code files created by the people in the community. Before you start creating your own code file, try if one of them works for your device. **Please open an issue if your device is working and not included in the supported models.**

Loading