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

Merge pull request #173 from smartHomeHub/rc

1.6.1
parents a8d703f1 20d47da7
Loading
Loading
Loading
Loading
+463 −0

File added.

Preview size limit exceeded, changes collapsed.

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

DOMAIN = 'smartir'
VERSION = '1.6.0'
VERSION_URL = (
VERSION = '1.6.1'
MANIFEST_URL = (
    "https://raw.githubusercontent.com/"
    "smartHomeHub/SmartIR/{}/version.json")
    "smartHomeHub/SmartIR/{}/"
    "custom_components/smartir/manifest.json")
REMOTE_BASE_URL = (
    "https://raw.githubusercontent.com/"
    "smartHomeHub/SmartIR/{}/smartir/")
    "smartHomeHub/SmartIR/{}/"
    "custom_components/smartir/")
COMPONENT_ABS_DIR = os.path.dirname(
    os.path.abspath(__file__))

@@ -63,7 +65,7 @@ async def async_setup(hass, config):

async def _update(hass, branch, do_update=False, notify_if_latest=True):
    try:
        request = requests.get(VERSION_URL.format(branch), stream=True, timeout=10)
        request = requests.get(MANIFEST_URL.format(branch), stream=True, timeout=10)
    except:
        _LOGGER.error("An error occurred while checking for updates. "
                      "Please check your internet connection.")
@@ -75,9 +77,9 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True):
        return

    data = request.json()
    last_version = data['version']
    min_ha_version = data['minHAVersion']
    release_notes = data['releaseNotes']
    min_ha_version = data['homeassistant']
    last_version = data['updater']['version']
    release_notes = data['updater']['releaseNotes']

    if StrictVersion(last_version) <= StrictVersion(VERSION):
        if notify_if_latest:
@@ -87,17 +89,20 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True):

    if StrictVersion(current_ha_version) < StrictVersion(min_ha_version):
        hass.components.persistent_notification.async_create(
            "There is a new version of SmartIR, but it is **incompatible** "
            "with your HA version. Please first update Home Assistant.", title='SmartIR')
            "There is a new version of SmartIR integration, but it is **incompatible** "
            "with your system. Please first update Home Assistant.", title='SmartIR')
        return

    if do_update is False:
        hass.components.persistent_notification.async_create(
            release_notes, title='SmartIR')
            "A new version of SmartIR integration is available ({}). "
            "Call the ``smartir.update_component`` service to update "
            "the integration. \n\n **Release notes:** \n{}"
            .format(last_version, release_notes), title='SmartIR')
        return

    # Begin update
    files = data['files']
    files = data['updater']['files']
    has_errors = False

    for file in files:
+14 −1
Original line number Diff line number Diff line
@@ -5,5 +5,18 @@
  "dependencies": [],
  "codeowners": ["@smartHomeHub"],
  "requirements": [],
  "homeassistant": "0.96.0b1"
  "homeassistant": "0.96.0b1",
  "updater": {
    "version": "1.6.1",
    "releaseNotes": "* Fix the built-in updater",
    "files": [
      "__init__.py",
      "climate.py",
      "media_player.py",
      "fan.py",
      "controller.py",
      "manifest.json",
      "services.yaml"
    ]
  }
}
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ Below are the code files created by the people in the community. Before you star
[1282](../codes/climate/1282.json)|AR-JW11 (Remote control)|Broadlink
[1283](../codes/climate/1283.json)|AR-AB5 (Remote control)|Broadlink
[1284](../codes/climate/1284.json)|AR-REG1U (Remote control)|Broadlink
[1285](../codes/climate/1285.json)|AR-RCE1E (Remote control)|Broadlink

#### Sharp
| Code | Supported Models | Controller |
+2 −2
Original line number Diff line number Diff line
{            
    "version": "1.6.0",
    "version": "1.6.1",
    "minHAVersion": "0.96.0b1",
    "releaseNotes": "A new version (1.6.0) is available that is compatible with your system. Call the ``smartir.update_component`` service to update the component.",
    "releaseNotes": "A new version (1.6.1) is available that is compatible with your system. Call the ``smartir.update_component`` service to update the component.",
    "files": [
        "__init__.py",
        "climate.py",