Unverified Commit 715260d9 authored by Vassilis Panos's avatar Vassilis Panos Committed by GitHub
Browse files

Merge pull request #102 from smartHomeHub/rc

1.4.1
parents 694494ca 1988a85d
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -12,8 +12,7 @@ _Please note that the device_code field only accepts positive numbers. The .json
**name** (Optional): The name of the device<br />
**unique_id** (Optional): An ID that uniquely identifies this device. If two devices have the same unique ID, Home Assistant will raise an exception.<br />
**device_code** (Required): .... (Accepts only positive numbers)<br />
**controller_send_service** (Required): The service that will be used to send the commands. Only `broadlink_send_packet` (Broadlink controller) and `mqtt.publish` is currently supported.<br />
**controller_command_topic** (Optional): MQTT topic on which to send commands when *controller_send_service* is mqtt.publish<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 MQTT topic on which to send commands.<br />
**temperature_sensor** (Optional): *entity_id* for a temperature sensor<br />
**humidity_sensor** (Optional): *entity_id* for a humidity sensor<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 />
@@ -32,7 +31,7 @@ climate:
    name: Office AC
    unique_id: office_ac
    device_code: 1000
    controller_send_service: switch.broadlink_send_packet_192_168_10_10
    controller_data: 192.168.10.10
    temperature_sensor: sensor.temperature
    humidity_sensor: sensor.humidity
    power_sensor: binary_sensor.ac_power
@@ -49,8 +48,7 @@ climate:
    name: Office AC
    unique_id: office_ac
    device_code: 2000
    controller_send_service: mqtt.publish
    controller_command_topic: home-assistant/office-ac/command
    controller_data: home-assistant/office-ac/command
    temperature_sensor: sensor.temperature
    humidity_sensor: sensor.humidity
    power_sensor: binary_sensor.ac_power
+3 −5
Original line number Diff line number Diff line
@@ -9,8 +9,7 @@ Find your device's brand code [here](FAN.md#available-codes-for-fan-devices) and
**name** (Optional): The name of the device<br />
**unique_id** (Optional): An ID that uniquely identifies this device. If two devices have the same unique ID, Home Assistant will raise an exception.<br />
**device_code** (Required): ...... (Accepts only positive numbers)<br />
**controller_send_service** (Required): The service that will be used to send the commands. Only `broadlink_send_packet` (Broadlink controller) and `mqtt.publish` is currently supported.<br />
**controller_command_topic** (Optional): MQTT topic on which to send commands when *controller_send_service* is mqtt.publish<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 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 />

## Example (using broadlink controller):
@@ -27,7 +26,7 @@ fan:
    name: Bedroom fan
    unique_id: bedroom_fan
    device_code: 1000
    controller_send_service: switch.broadlink_send_packet_192_168_10_10
    controller_data: 192.168.10.10
    power_sensor: binary_sensor.fan_power
```
Make sure the broadlink switch is already installed. Go to the Home Assistant UI/dev service, find the broadlink send_packet service and copy the name of it.
@@ -42,8 +41,7 @@ fan:
    name: Bedroom fan
    unique_id: bedroom_fan
    device_code: 2000
    controller_send_service: mqtt.publish
    controller_command_topic: home-assistant/bedroom-fan/command
    controller_data: home-assistant/bedroom-fan/command
    power_sensor: binary_sensor.fan_power
```

+3 −5
Original line number Diff line number Diff line
@@ -9,8 +9,7 @@ Find your device's brand code [here](MEDIA_PLAYER.md#available-codes-for-tv-devi
**name** (Optional): The name of the device<br />
**unique_id** (Optional): An ID that uniquely identifies this device. If two devices have the same unique ID, Home Assistant will raise an exception.<br />
**device_code** (Required): ...... (Accepts only positive numbers)<br />
**controller_send_service** (Required): The service that will be used to send the commands. Only `broadlink_send_packet` (Broadlink controller) and `mqtt.publish` is currently supported.<br />
**controller_command_topic** (Optional): MQTT topic on which to send commands when *controller_send_service* is mqtt.publish<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 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 />

## Example (using broadlink controller):
@@ -27,7 +26,7 @@ media_player:
    name: Living room TV
    unique_id: living_room_tv
    device_code: 1000
    controller_send_service: switch.broadlink_send_packet_192_168_10_10
    controller_data: 192.168.10.10
    power_sensor: binary_sensor.tv_power
```
Make sure the broadlink switch is already installed. Go to the Home Assistant UI/dev service, find the broadlink send_packet service and copy the name of it.
@@ -42,8 +41,7 @@ media_player:
    name: Living room TV
    unique_id: living_room_tv
    device_code: 2000
    controller_send_service: mqtt.publish
    controller_command_topic: home-assistant/living-room-tv/command
    controller_data: home-assistant/living-room-tv/command
    power_sensor: binary_sensor.tv_power
```

+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ from homeassistant.helpers.typing import ConfigType
_LOGGER = logging.getLogger(__name__)

DOMAIN = 'smartir'
VERSION = '1.3.9'
VERSION = '1.4.1'
VERSION_URL = (
    "https://raw.githubusercontent.com/"
    "smartHomeHub/SmartIR/{}/version.json")
+4 −8
Original line number Diff line number Diff line
@@ -26,8 +26,7 @@ DEFAULT_NAME = "SmartIR Climate"

CONF_UNIQUE_ID = 'unique_id'
CONF_DEVICE_CODE = 'device_code'
CONF_CONTROLLER_SEND_SERVICE = "controller_send_service"
CONF_CONTROLLER_COMMAND_TOPIC = "controller_command_topic"
CONF_CONTROLLER_DATA = "controller_data"
CONF_TEMPERATURE_SENSOR = 'temperature_sensor'
CONF_HUMIDITY_SENSOR = 'humidity_sensor'
CONF_POWER_SENSOR = 'power_sensor'
@@ -43,8 +42,7 @@ 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_SEND_SERVICE): cv.entity_id,
    vol.Optional(CONF_CONTROLLER_COMMAND_TOPIC): cv.string,
    vol.Required(CONF_CONTROLLER_DATA): cv.string,
    vol.Optional(CONF_TEMPERATURE_SENSOR): cv.entity_id,
    vol.Optional(CONF_HUMIDITY_SENSOR): cv.entity_id,
    vol.Optional(CONF_POWER_SENSOR): cv.entity_id
@@ -96,8 +94,7 @@ class SmartIRClimate(ClimateDevice, RestoreEntity):
        self._unique_id = config.get(CONF_UNIQUE_ID)
        self._name = config.get(CONF_NAME)
        self._device_code = config.get(CONF_DEVICE_CODE)
        self._controller_send_service = config.get(CONF_CONTROLLER_SEND_SERVICE)
        self._controller_command_topic = config.get(CONF_CONTROLLER_COMMAND_TOPIC)
        self._controller_data = config.get(CONF_CONTROLLER_DATA)
        self._temperature_sensor = config.get(CONF_TEMPERATURE_SENSOR)
        self._humidity_sensor = config.get(CONF_HUMIDITY_SENSOR)
        self._power_sensor = config.get(CONF_POWER_SENSOR)
@@ -132,8 +129,7 @@ class SmartIRClimate(ClimateDevice, RestoreEntity):
            self.hass,
            self._supported_controller, 
            self._commands_encoding,
            self._controller_send_service,
            self._controller_command_topic)
            self._controller_data)
            
    async def async_added_to_hass(self):
        """Run when entity about to be added."""
Loading