Loading custom_components/smartir/__init__.py +2 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True): dest = os.path.join(COMPONENT_ABS_DIR, file) os.makedirs(os.path.dirname(dest), exist_ok=True) await Helper.downloader(source, dest) except: except Exception: has_errors = True _LOGGER.error("Error updating %s. Please update the file manually.", file) Loading @@ -120,7 +120,7 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True): hass.components.persistent_notification.async_create( "Successfully updated to {}. Please restart Home Assistant." .format(last_version), title='SmartIR') except: except Exception: _LOGGER.error("An error occurred while checking for updates.") class Helper(): Loading custom_components/smartir/climate.py +2 −2 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= "codes/climate/{}.json") await Helper.downloader(codes_source.format(device_code), device_json_path) except: except Exception: _LOGGER.error("There was an error while downloading the device Json file. " \ "Please check your internet connection or if the device code " \ "exists on GitHub. If the problem still exists please " \ Loading @@ -79,7 +79,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= with open(device_json_path) as j: try: device_data = json.load(j) except: except Exception: _LOGGER.error("The device Json file is invalid") return Loading custom_components/smartir/controller.py +0 −2 Original line number Diff line number Diff line import asyncio from base64 import b64encode import binascii import requests import logging from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import split_entity_id from . import Helper _LOGGER = logging.getLogger(__name__) Loading custom_components/smartir/fan.py +2 −2 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= "codes/fan/{}.json") await Helper.downloader(codes_source.format(device_code), device_json_path) except: except Exception: _LOGGER.error("There was an error while downloading the device Json file. " \ "Please check your internet connection or if the device code " \ "exists on GitHub. If the problem still exists please " \ Loading @@ -68,7 +68,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= with open(device_json_path) as j: try: device_data = json.load(j) except: except Exception: _LOGGER.error("The device JSON file is invalid") return Loading custom_components/smartir/media_player.py +2 −3 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ from homeassistant.components.media_player.const import ( SUPPORT_SELECT_SOURCE, MEDIA_TYPE_CHANNEL) from homeassistant.const import ( CONF_NAME, STATE_OFF, STATE_ON, STATE_UNKNOWN) from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.restore_state import RestoreEntity from . import COMPONENT_ABS_DIR, Helper Loading Loading @@ -63,7 +62,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= "codes/media_player/{}.json") await Helper.downloader(codes_source.format(device_code), device_json_path) except: except Exception: _LOGGER.error("There was an error while downloading the device Json file. " \ "Please check your internet connection or if the device code " \ "exists on GitHub. If the problem still exists please " \ Loading @@ -73,7 +72,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= with open(device_json_path) as j: try: device_data = json.load(j) except: except Exception: _LOGGER.error("The device JSON file is invalid") return Loading Loading
custom_components/smartir/__init__.py +2 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True): dest = os.path.join(COMPONENT_ABS_DIR, file) os.makedirs(os.path.dirname(dest), exist_ok=True) await Helper.downloader(source, dest) except: except Exception: has_errors = True _LOGGER.error("Error updating %s. Please update the file manually.", file) Loading @@ -120,7 +120,7 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True): hass.components.persistent_notification.async_create( "Successfully updated to {}. Please restart Home Assistant." .format(last_version), title='SmartIR') except: except Exception: _LOGGER.error("An error occurred while checking for updates.") class Helper(): Loading
custom_components/smartir/climate.py +2 −2 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= "codes/climate/{}.json") await Helper.downloader(codes_source.format(device_code), device_json_path) except: except Exception: _LOGGER.error("There was an error while downloading the device Json file. " \ "Please check your internet connection or if the device code " \ "exists on GitHub. If the problem still exists please " \ Loading @@ -79,7 +79,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= with open(device_json_path) as j: try: device_data = json.load(j) except: except Exception: _LOGGER.error("The device Json file is invalid") return Loading
custom_components/smartir/controller.py +0 −2 Original line number Diff line number Diff line import asyncio from base64 import b64encode import binascii import requests import logging from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import split_entity_id from . import Helper _LOGGER = logging.getLogger(__name__) Loading
custom_components/smartir/fan.py +2 −2 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= "codes/fan/{}.json") await Helper.downloader(codes_source.format(device_code), device_json_path) except: except Exception: _LOGGER.error("There was an error while downloading the device Json file. " \ "Please check your internet connection or if the device code " \ "exists on GitHub. If the problem still exists please " \ Loading @@ -68,7 +68,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= with open(device_json_path) as j: try: device_data = json.load(j) except: except Exception: _LOGGER.error("The device JSON file is invalid") return Loading
custom_components/smartir/media_player.py +2 −3 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ from homeassistant.components.media_player.const import ( SUPPORT_SELECT_SOURCE, MEDIA_TYPE_CHANNEL) from homeassistant.const import ( CONF_NAME, STATE_OFF, STATE_ON, STATE_UNKNOWN) from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.restore_state import RestoreEntity from . import COMPONENT_ABS_DIR, Helper Loading Loading @@ -63,7 +62,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= "codes/media_player/{}.json") await Helper.downloader(codes_source.format(device_code), device_json_path) except: except Exception: _LOGGER.error("There was an error while downloading the device Json file. " \ "Please check your internet connection or if the device code " \ "exists on GitHub. If the problem still exists please " \ Loading @@ -73,7 +72,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= with open(device_json_path) as j: try: device_data = json.load(j) except: except Exception: _LOGGER.error("The device JSON file is invalid") return Loading