feat: rename the project to Infrarize
This commit is contained in:
@@ -21,9 +21,9 @@ Issues not containing the minimum requirements will be closed:
|
|||||||
|
|
||||||
**Home Assistant version**
|
**Home Assistant version**
|
||||||
|
|
||||||
**SmartIR version**
|
**Infrarize version**
|
||||||
|
|
||||||
**SmartIR configuration**
|
**Infrarize configuration**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -131,5 +131,5 @@ dmypy.json
|
|||||||
temp/
|
temp/
|
||||||
tmp/
|
tmp/
|
||||||
|
|
||||||
# SmartIR capture tool session (contains local MQTT credentials/config)
|
# Infrarize capture tool session (contains local MQTT credentials/config)
|
||||||
tools/capture_session.json
|
tools/capture_session.json
|
||||||
|
|||||||
@@ -18,16 +18,16 @@ from homeassistant.helpers.typing import ConfigType
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DOMAIN = 'smartir'
|
DOMAIN = 'infrarize'
|
||||||
VERSION = '1.18.1'
|
VERSION = '1.18.1'
|
||||||
MANIFEST_URL = (
|
MANIFEST_URL = (
|
||||||
"https://raw.githubusercontent.com/"
|
"https://raw.githubusercontent.com/"
|
||||||
"kobimx/SmartIR/{}/"
|
"kobimx/Infrarize/{}/"
|
||||||
"custom_components/smartir/manifest.json")
|
"custom_components/infrarize/manifest.json")
|
||||||
REMOTE_BASE_URL = (
|
REMOTE_BASE_URL = (
|
||||||
"https://raw.githubusercontent.com/"
|
"https://raw.githubusercontent.com/"
|
||||||
"kobimx/SmartIR/{}/"
|
"kobimx/Infrarize/{}/"
|
||||||
"custom_components/smartir/")
|
"custom_components/infrarize/")
|
||||||
COMPONENT_ABS_DIR = os.path.dirname(
|
COMPONENT_ABS_DIR = os.path.dirname(
|
||||||
os.path.abspath(__file__))
|
os.path.abspath(__file__))
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ CONFIG_SCHEMA = vol.Schema({
|
|||||||
}, extra=vol.ALLOW_EXTRA)
|
}, extra=vol.ALLOW_EXTRA)
|
||||||
|
|
||||||
async def async_setup(hass, config):
|
async def async_setup(hass, config):
|
||||||
"""Set up the SmartIR component."""
|
"""Set up the Infrarize component."""
|
||||||
conf = config.get(DOMAIN)
|
conf = config.get(DOMAIN)
|
||||||
|
|
||||||
if conf is None:
|
if conf is None:
|
||||||
@@ -68,7 +68,7 @@ async def async_setup(hass, config):
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, entry):
|
async def async_setup_entry(hass, entry):
|
||||||
"""Set up SmartIR from a config entry (UI-configured device)."""
|
"""Set up Infrarize from a config entry (UI-configured device)."""
|
||||||
platform = entry.data.get('platform')
|
platform = entry.data.get('platform')
|
||||||
if not platform:
|
if not platform:
|
||||||
return False
|
return False
|
||||||
@@ -85,7 +85,7 @@ async def _async_options_updated(hass, entry):
|
|||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(hass, entry):
|
async def async_unload_entry(hass, entry):
|
||||||
"""Unload a SmartIR config entry."""
|
"""Unload an Infrarize config entry."""
|
||||||
platform = entry.data.get('platform')
|
platform = entry.data.get('platform')
|
||||||
if not platform:
|
if not platform:
|
||||||
return True
|
return True
|
||||||
@@ -106,21 +106,21 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True):
|
|||||||
if notify_if_latest:
|
if notify_if_latest:
|
||||||
hass.components.persistent_notification.async_create(
|
hass.components.persistent_notification.async_create(
|
||||||
"You're already using the latest version!",
|
"You're already using the latest version!",
|
||||||
title='SmartIR')
|
title='Infrarize')
|
||||||
return
|
return
|
||||||
|
|
||||||
if StrictVersion(current_ha_version) < StrictVersion(min_ha_version):
|
if StrictVersion(current_ha_version) < StrictVersion(min_ha_version):
|
||||||
hass.components.persistent_notification.async_create(
|
hass.components.persistent_notification.async_create(
|
||||||
"There is a new version of SmartIR integration, but it is **incompatible** "
|
"There is a new version of Infrarize integration, but it is **incompatible** "
|
||||||
"with your system. Please first update Home Assistant.", title='SmartIR')
|
"with your system. Please first update Home Assistant.", title='Infrarize')
|
||||||
return
|
return
|
||||||
|
|
||||||
if do_update is False:
|
if do_update is False:
|
||||||
hass.components.persistent_notification.async_create(
|
hass.components.persistent_notification.async_create(
|
||||||
"A new version of SmartIR integration is available ({}). "
|
"A new version of Infrarize integration is available ({}). "
|
||||||
"Call the ``smartir.update_component`` service to update "
|
"Call the ``infrarize.update_component`` service to update "
|
||||||
"the integration. \n\n **Release notes:** \n{}"
|
"the integration. \n\n **Release notes:** \n{}"
|
||||||
.format(last_version, release_notes), title='SmartIR')
|
.format(last_version, release_notes), title='Infrarize')
|
||||||
return
|
return
|
||||||
|
|
||||||
# Begin update
|
# Begin update
|
||||||
@@ -139,12 +139,12 @@ async def _update(hass, branch, do_update=False, notify_if_latest=True):
|
|||||||
|
|
||||||
if has_errors:
|
if has_errors:
|
||||||
hass.components.persistent_notification.async_create(
|
hass.components.persistent_notification.async_create(
|
||||||
"There was an error updating one or more files of SmartIR. "
|
"There was an error updating one or more files of Infrarize. "
|
||||||
"Please check the logs for more information.", title='SmartIR')
|
"Please check the logs for more information.", title='Infrarize')
|
||||||
else:
|
else:
|
||||||
hass.components.persistent_notification.async_create(
|
hass.components.persistent_notification.async_create(
|
||||||
"Successfully updated to {}. Please restart Home Assistant."
|
"Successfully updated to {}. Please restart Home Assistant."
|
||||||
.format(last_version), title='SmartIR')
|
.format(last_version), title='Infrarize')
|
||||||
except Exception:
|
except Exception:
|
||||||
_LOGGER.error("An error occurred while checking for updates.")
|
_LOGGER.error("An error occurred while checking for updates.")
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ from .controller import get_controller
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_NAME = "SmartIR Climate"
|
DEFAULT_NAME = "Infrarize Climate"
|
||||||
DEFAULT_DELAY = 0.5
|
DEFAULT_DELAY = 0.5
|
||||||
|
|
||||||
CONF_UNIQUE_ID = 'unique_id'
|
CONF_UNIQUE_ID = 'unique_id'
|
||||||
@@ -54,7 +54,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, entry, async_add_entities):
|
async def async_setup_entry(hass, entry, async_add_entities):
|
||||||
"""Set up SmartIR Climate from a config entry."""
|
"""Set up Infrarize Climate from a config entry."""
|
||||||
config = {**entry.data, **entry.options}
|
config = {**entry.data, **entry.options}
|
||||||
config.pop('platform', None)
|
config.pop('platform', None)
|
||||||
config.setdefault('unique_id', entry.unique_id)
|
config.setdefault('unique_id', entry.unique_id)
|
||||||
@@ -63,7 +63,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
|||||||
|
|
||||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||||
"""Set up the IR Climate platform."""
|
"""Set up the IR Climate platform."""
|
||||||
_LOGGER.debug("Setting up the smartir platform")
|
_LOGGER.debug("Setting up the infrarize platform")
|
||||||
device_code = config.get(CONF_DEVICE_CODE)
|
device_code = config.get(CONF_DEVICE_CODE)
|
||||||
device_files_subdir = os.path.join('codes', 'climate')
|
device_files_subdir = os.path.join('codes', 'climate')
|
||||||
device_files_absdir = os.path.join(COMPONENT_ABS_DIR, device_files_subdir)
|
device_files_absdir = os.path.join(COMPONENT_ABS_DIR, device_files_subdir)
|
||||||
@@ -80,7 +80,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
codes_source = ("https://raw.githubusercontent.com/"
|
codes_source = ("https://raw.githubusercontent.com/"
|
||||||
"kobimx/SmartIR/master/"
|
"kobimx/Infrarize/master/"
|
||||||
"codes/climate/{}.json")
|
"codes/climate/{}.json")
|
||||||
|
|
||||||
await Helper.downloader(codes_source.format(device_code), device_json_path)
|
await Helper.downloader(codes_source.format(device_code), device_json_path)
|
||||||
@@ -101,13 +101,13 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
_LOGGER.error("The device JSON file is invalid")
|
_LOGGER.error("The device JSON file is invalid")
|
||||||
return
|
return
|
||||||
|
|
||||||
async_add_entities([SmartIRClimate(
|
async_add_entities([InfrarizeClimate(
|
||||||
hass, config, device_data
|
hass, config, device_data
|
||||||
)])
|
)])
|
||||||
|
|
||||||
class SmartIRClimate(ClimateEntity, RestoreEntity):
|
class InfrarizeClimate(ClimateEntity, RestoreEntity):
|
||||||
def __init__(self, hass, config, device_data):
|
def __init__(self, hass, config, device_data):
|
||||||
_LOGGER.debug(f"SmartIRClimate init started for device {config.get(CONF_NAME)} supported models {device_data['supportedModels']}")
|
_LOGGER.debug(f"InfrarizeClimate init started for device {config.get(CONF_NAME)} supported models {device_data['supportedModels']}")
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self._unique_id = config.get(CONF_UNIQUE_ID)
|
self._unique_id = config.get(CONF_UNIQUE_ID)
|
||||||
self._name = config.get(CONF_NAME)
|
self._name = config.get(CONF_NAME)
|
||||||
+12
-12
@@ -1,4 +1,4 @@
|
|||||||
"""Config flow for SmartIR — 6-step UI wizard with device list selection."""
|
"""Config flow for Infrarize — 6-step UI wizard with device list selection."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
@@ -47,7 +47,7 @@ from .const import (
|
|||||||
PLATFORMS,
|
PLATFORMS,
|
||||||
)
|
)
|
||||||
|
|
||||||
DOMAIN = "smartir"
|
DOMAIN = "infrarize"
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ async def _load_device_json(platform: str, device_code: int) -> dict | None:
|
|||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
source = (
|
source = (
|
||||||
"https://raw.githubusercontent.com/"
|
"https://raw.githubusercontent.com/"
|
||||||
f"kobimx/SmartIR/master/codes/{subdir}/{device_code}.json"
|
f"kobimx/Infrarize/master/codes/{subdir}/{device_code}.json"
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await Helper.downloader(source, path)
|
await Helper.downloader(source, path)
|
||||||
@@ -120,7 +120,7 @@ def _options_schema(platform: str, defaults: dict | None = None) -> vol.Schema:
|
|||||||
return vol.Optional(key)
|
return vol.Optional(key)
|
||||||
|
|
||||||
# Power sensors are only ever checked for on/off state (see
|
# Power sensors are only ever checked for on/off state (see
|
||||||
# SmartIRClimate._async_power_sensor_changed and the equivalent methods in
|
# InfrarizeClimate._async_power_sensor_changed and the equivalent methods in
|
||||||
# fan.py, light.py, media_player.py, which compare .state to STATE_ON/STATE_OFF)
|
# fan.py, light.py, media_player.py, which compare .state to STATE_ON/STATE_OFF)
|
||||||
# so restrict the picker to domains that expose a binary on/off state.
|
# so restrict the picker to domains that expose a binary on/off state.
|
||||||
power_sensor_selector = EntitySelector(
|
power_sensor_selector = EntitySelector(
|
||||||
@@ -237,8 +237,8 @@ def _device_placeholders(device_data: dict, platform: str) -> dict:
|
|||||||
# ── Config Flow ───────────────────────────────────────────────────────────────
|
# ── Config Flow ───────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
class SmartIRConfigFlow(ConfigFlow, domain=DOMAIN):
|
class InfrarizeConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
"""Handle multi-step UI config flow for SmartIR."""
|
"""Handle multi-step UI config flow for Infrarize."""
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
@@ -518,7 +518,7 @@ class SmartIRConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self._delay = DEFAULT_DELAY
|
self._delay = DEFAULT_DELAY
|
||||||
|
|
||||||
uid = (
|
uid = (
|
||||||
f"smartir_{self._platform}_{self._device_code}"
|
f"infrarize_{self._platform}_{self._device_code}"
|
||||||
f"_{self._controller_data}"
|
f"_{self._controller_data}"
|
||||||
)
|
)
|
||||||
await self.async_set_unique_id(uid)
|
await self.async_set_unique_id(uid)
|
||||||
@@ -576,21 +576,21 @@ class SmartIRConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
}
|
}
|
||||||
options.update(_parse_options(self._platform, options_input))
|
options.update(_parse_options(self._platform, options_input))
|
||||||
|
|
||||||
mfr = self._device_data.get("manufacturer", "SmartIR")
|
mfr = self._device_data.get("manufacturer", "Infrarize")
|
||||||
title = f"{mfr} — {self._device_name}"
|
title = f"{mfr} — {self._device_name}"
|
||||||
return self.async_create_entry(title=title, data=data, options=options)
|
return self.async_create_entry(title=title, data=data, options=options)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> SmartIROptionsFlow:
|
def async_get_options_flow(config_entry: ConfigEntry) -> InfrarizeOptionsFlow:
|
||||||
return SmartIROptionsFlow(config_entry)
|
return InfrarizeOptionsFlow(config_entry)
|
||||||
|
|
||||||
|
|
||||||
# ── Options Flow ──────────────────────────────────────────────────────────────
|
# ── Options Flow ──────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
class SmartIROptionsFlow(OptionsFlow):
|
class InfrarizeOptionsFlow(OptionsFlow):
|
||||||
"""Edit controller and sensor settings for an existing SmartIR entry."""
|
"""Edit controller and sensor settings for an existing Infrarize entry."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||||
self._entry = config_entry
|
self._entry = config_entry
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
"""Constants for the SmartIR config flow and platforms."""
|
"""Constants for the Infrarize config flow and platforms."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
# ── Sentinels ──────────────────────────────────────────────────────────────────
|
# ── Sentinels ──────────────────────────────────────────────────────────────────
|
||||||
@@ -38,10 +38,10 @@ PLATFORM_SUBDIR: dict[str, str] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_DEVICE_NAMES: dict[str, str] = {
|
DEFAULT_DEVICE_NAMES: dict[str, str] = {
|
||||||
"climate": "SmartIR Climate",
|
"climate": "Infrarize Climate",
|
||||||
"fan": "SmartIR Fan",
|
"fan": "Infrarize Fan",
|
||||||
"media_player": "SmartIR Media Player",
|
"media_player": "Infrarize Media Player",
|
||||||
"light": "SmartIR Light",
|
"light": "Infrarize Light",
|
||||||
}
|
}
|
||||||
|
|
||||||
# ── Controller metadata ────────────────────────────────────────────────────────
|
# ── Controller metadata ────────────────────────────────────────────────────────
|
||||||
@@ -24,7 +24,7 @@ from .controller import get_controller
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_NAME = "SmartIR Fan"
|
DEFAULT_NAME = "Infrarize Fan"
|
||||||
DEFAULT_DELAY = 0.5
|
DEFAULT_DELAY = 0.5
|
||||||
|
|
||||||
CONF_UNIQUE_ID = 'unique_id'
|
CONF_UNIQUE_ID = 'unique_id'
|
||||||
@@ -46,7 +46,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, entry, async_add_entities):
|
async def async_setup_entry(hass, entry, async_add_entities):
|
||||||
"""Set up SmartIR Fan from a config entry."""
|
"""Set up Infrarize Fan from a config entry."""
|
||||||
config = {**entry.data, **entry.options}
|
config = {**entry.data, **entry.options}
|
||||||
config.pop('platform', None)
|
config.pop('platform', None)
|
||||||
config.setdefault('unique_id', entry.unique_id)
|
config.setdefault('unique_id', entry.unique_id)
|
||||||
@@ -71,7 +71,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
codes_source = ("https://raw.githubusercontent.com/"
|
codes_source = ("https://raw.githubusercontent.com/"
|
||||||
"kobimx/SmartIR/master/"
|
"kobimx/Infrarize/master/"
|
||||||
"codes/fan/{}.json")
|
"codes/fan/{}.json")
|
||||||
|
|
||||||
await Helper.downloader(codes_source.format(device_code), device_json_path)
|
await Helper.downloader(codes_source.format(device_code), device_json_path)
|
||||||
@@ -92,11 +92,11 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
_LOGGER.error("The device JSON file is invalid")
|
_LOGGER.error("The device JSON file is invalid")
|
||||||
return
|
return
|
||||||
|
|
||||||
async_add_entities([SmartIRFan(
|
async_add_entities([InfrarizeFan(
|
||||||
hass, config, device_data
|
hass, config, device_data
|
||||||
)])
|
)])
|
||||||
|
|
||||||
class SmartIRFan(FanEntity, RestoreEntity):
|
class InfrarizeFan(FanEntity, RestoreEntity):
|
||||||
def __init__(self, hass, config, device_data):
|
def __init__(self, hass, config, device_data):
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self._unique_id = config.get(CONF_UNIQUE_ID)
|
self._unique_id = config.get(CONF_UNIQUE_ID)
|
||||||
@@ -27,7 +27,7 @@ from .controller import get_controller
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_NAME = "SmartIR Light"
|
DEFAULT_NAME = "Infrarize Light"
|
||||||
DEFAULT_DELAY = 0.5
|
DEFAULT_DELAY = 0.5
|
||||||
|
|
||||||
CONF_UNIQUE_ID = "unique_id"
|
CONF_UNIQUE_ID = "unique_id"
|
||||||
@@ -57,7 +57,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, entry, async_add_entities):
|
async def async_setup_entry(hass, entry, async_add_entities):
|
||||||
"""Set up SmartIR Light from a config entry."""
|
"""Set up Infrarize Light from a config entry."""
|
||||||
config = {**entry.data, **entry.options}
|
config = {**entry.data, **entry.options}
|
||||||
config.pop('platform', None)
|
config.pop('platform', None)
|
||||||
config.setdefault('unique_id', entry.unique_id)
|
config.setdefault('unique_id', entry.unique_id)
|
||||||
@@ -90,7 +90,7 @@ async def async_setup_platform(
|
|||||||
try:
|
try:
|
||||||
codes_source = (
|
codes_source = (
|
||||||
"https://raw.githubusercontent.com/"
|
"https://raw.githubusercontent.com/"
|
||||||
"kobimx/SmartIR/master/"
|
"kobimx/Infrarize/master/"
|
||||||
"codes/light/{}.json"
|
"codes/light/{}.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ async def async_setup_platform(
|
|||||||
_LOGGER.error("The device JSON file is invalid")
|
_LOGGER.error("The device JSON file is invalid")
|
||||||
return
|
return
|
||||||
|
|
||||||
async_add_entities([SmartIRLight(hass, config, device_data)])
|
async_add_entities([InfrarizeLight(hass, config, device_data)])
|
||||||
|
|
||||||
|
|
||||||
# find the closest match in a sorted list
|
# find the closest match in a sorted list
|
||||||
@@ -137,7 +137,7 @@ def closest_match(value, list):
|
|||||||
return len(list) - 1
|
return len(list) - 1
|
||||||
|
|
||||||
|
|
||||||
class SmartIRLight(LightEntity, RestoreEntity):
|
class InfrarizeLight(LightEntity, RestoreEntity):
|
||||||
def __init__(self, hass, config, device_data):
|
def __init__(self, hass, config, device_data):
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self._unique_id = config.get(CONF_UNIQUE_ID)
|
self._unique_id = config.get(CONF_UNIQUE_ID)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"domain": "smartir",
|
"domain": "infrarize",
|
||||||
"name": "SmartIR",
|
"name": "Infrarize",
|
||||||
"documentation": "https://github.com/kobimx/SmartIR",
|
"documentation": "https://github.com/kobimx/Infrarize",
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": ["@kobimx"],
|
"codeowners": ["@kobimx"],
|
||||||
"requirements": ["aiofiles>=0.6.0"],
|
"requirements": ["aiofiles>=0.6.0"],
|
||||||
+5
-5
@@ -19,7 +19,7 @@ from .controller import get_controller
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_NAME = "SmartIR Media Player"
|
DEFAULT_NAME = "Infrarize Media Player"
|
||||||
DEFAULT_DEVICE_CLASS = "tv"
|
DEFAULT_DEVICE_CLASS = "tv"
|
||||||
DEFAULT_DELAY = 0.5
|
DEFAULT_DELAY = 0.5
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, entry, async_add_entities):
|
async def async_setup_entry(hass, entry, async_add_entities):
|
||||||
"""Set up SmartIR Media Player from a config entry."""
|
"""Set up Infrarize Media Player from a config entry."""
|
||||||
config = {**entry.data, **entry.options}
|
config = {**entry.data, **entry.options}
|
||||||
config.pop('platform', None)
|
config.pop('platform', None)
|
||||||
config.setdefault('unique_id', entry.unique_id)
|
config.setdefault('unique_id', entry.unique_id)
|
||||||
@@ -69,7 +69,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
codes_source = ("https://raw.githubusercontent.com/"
|
codes_source = ("https://raw.githubusercontent.com/"
|
||||||
"kobimx/SmartIR/master/"
|
"kobimx/Infrarize/master/"
|
||||||
"codes/media_player/{}.json")
|
"codes/media_player/{}.json")
|
||||||
|
|
||||||
await Helper.downloader(codes_source.format(device_code), device_json_path)
|
await Helper.downloader(codes_source.format(device_code), device_json_path)
|
||||||
@@ -90,11 +90,11 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
_LOGGER.error("The device JSON file is invalid")
|
_LOGGER.error("The device JSON file is invalid")
|
||||||
return
|
return
|
||||||
|
|
||||||
async_add_entities([SmartIRMediaPlayer(
|
async_add_entities([InfrarizeMediaPlayer(
|
||||||
hass, config, device_data
|
hass, config, device_data
|
||||||
)])
|
)])
|
||||||
|
|
||||||
class SmartIRMediaPlayer(MediaPlayerEntity, RestoreEntity):
|
class InfrarizeMediaPlayer(MediaPlayerEntity, RestoreEntity):
|
||||||
def __init__(self, hass, config, device_data):
|
def __init__(self, hass, config, device_data):
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self._unique_id = config.get(CONF_UNIQUE_ID)
|
self._unique_id = config.get(CONF_UNIQUE_ID)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
check_updates:
|
||||||
|
description: Check for Infrarize updates.
|
||||||
|
update_component:
|
||||||
|
description: Update Infrarize component.
|
||||||
@@ -2,49 +2,49 @@
|
|||||||
"config": {
|
"config": {
|
||||||
"step": {
|
"step": {
|
||||||
"user": {
|
"user": {
|
||||||
"title": "SmartIR — Choose Platform",
|
"title": "Infrarize — Choose Platform",
|
||||||
"description": "Select the type of device you want to control via IR.",
|
"description": "Select the type of device you want to control via IR.",
|
||||||
"data": {
|
"data": {
|
||||||
"platform": "Platform"
|
"platform": "Platform"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"controller_filter": {
|
"controller_filter": {
|
||||||
"title": "SmartIR — Filter by Controller",
|
"title": "Infrarize — Filter by Controller",
|
||||||
"description": "Narrow the device list to a specific controller type, or show all.",
|
"description": "Narrow the device list to a specific controller type, or show all.",
|
||||||
"data": {
|
"data": {
|
||||||
"controller_type": "Controller Type"
|
"controller_type": "Controller Type"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"manufacturer": {
|
"manufacturer": {
|
||||||
"title": "SmartIR — Select Manufacturer",
|
"title": "Infrarize — Select Manufacturer",
|
||||||
"description": "Choose your device manufacturer. Select **'Enter code manually'** if your device is not listed.",
|
"description": "Choose your device manufacturer. Select **'Enter code manually'** if your device is not listed.",
|
||||||
"data": {
|
"data": {
|
||||||
"manufacturer": "Manufacturer"
|
"manufacturer": "Manufacturer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"device_select": {
|
"device_select": {
|
||||||
"title": "SmartIR — Select Device",
|
"title": "Infrarize — Select Device",
|
||||||
"description": "Choose the device model for **{manufacturer}**. Each entry shows the numeric code and supported model names.",
|
"description": "Choose the device model for **{manufacturer}**. Each entry shows the numeric code and supported model names.",
|
||||||
"data": {
|
"data": {
|
||||||
"device_code": "Device"
|
"device_code": "Device"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"device_manual": {
|
"device_manual": {
|
||||||
"title": "SmartIR — Enter Device Code",
|
"title": "Infrarize — Enter Device Code",
|
||||||
"description": "Enter the numeric device code. The file will be loaded from local storage or downloaded from GitHub.",
|
"description": "Enter the numeric device code. The file will be loaded from local storage or downloaded from GitHub.",
|
||||||
"data": {
|
"data": {
|
||||||
"device_code": "Device Code"
|
"device_code": "Device Code"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"device_name": {
|
"device_name": {
|
||||||
"title": "SmartIR — Confirm Device Name",
|
"title": "Infrarize — Confirm Device Name",
|
||||||
"description": "**{manufacturer}** — {models}\nController: {controller_type} | Code: {device_code}\n\nEdit the name shown in Home Assistant.",
|
"description": "**{manufacturer}** — {models}\nController: {controller_type} | Code: {device_code}\n\nEdit the name shown in Home Assistant.",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "Device Name"
|
"name": "Device Name"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"controller": {
|
"controller": {
|
||||||
"title": "SmartIR — Controller Connection",
|
"title": "Infrarize — Controller Connection",
|
||||||
"description": "Controller type: **{controller_type}**\n\n{controller_hint}",
|
"description": "Controller type: **{controller_type}**\n\n{controller_hint}",
|
||||||
"data": {
|
"data": {
|
||||||
"controller_data": "Controller Data",
|
"controller_data": "Controller Data",
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"options_platform": {
|
"options_platform": {
|
||||||
"title": "SmartIR — Optional Settings",
|
"title": "Infrarize — Optional Settings",
|
||||||
"description": "**{manufacturer}** — {models}\nController: {controller_type}\n\nAll fields below are optional.",
|
"description": "**{manufacturer}** — {models}\nController: {controller_type}\n\nAll fields below are optional.",
|
||||||
"data": {
|
"data": {
|
||||||
"temperature_sensor": "Temperature Sensor",
|
"temperature_sensor": "Temperature Sensor",
|
||||||
@@ -70,13 +70,13 @@
|
|||||||
"unknown": "Unexpected error — check the Home Assistant logs."
|
"unknown": "Unexpected error — check the Home Assistant logs."
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"already_configured": "A SmartIR device with this code and controller is already configured."
|
"already_configured": "A Infrarize device with this code and controller is already configured."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"step": {
|
"step": {
|
||||||
"controller": {
|
"controller": {
|
||||||
"title": "SmartIR — Edit Controller",
|
"title": "Infrarize — Edit Controller",
|
||||||
"description": "Controller type: **{controller_type}**\n\n{controller_hint}",
|
"description": "Controller type: **{controller_type}**\n\n{controller_hint}",
|
||||||
"data": {
|
"data": {
|
||||||
"controller_data": "Controller Data",
|
"controller_data": "Controller Data",
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"options_platform": {
|
"options_platform": {
|
||||||
"title": "SmartIR — Edit Optional Settings",
|
"title": "Infrarize — Edit Optional Settings",
|
||||||
"description": "**{manufacturer}** — {models}\nController: {controller_type}",
|
"description": "**{manufacturer}** — {models}\nController: {controller_type}",
|
||||||
"data": {
|
"data": {
|
||||||
"temperature_sensor": "Temperature Sensor",
|
"temperature_sensor": "Temperature Sensor",
|
||||||
+11
-11
@@ -2,49 +2,49 @@
|
|||||||
"config": {
|
"config": {
|
||||||
"step": {
|
"step": {
|
||||||
"user": {
|
"user": {
|
||||||
"title": "SmartIR — Choose Platform",
|
"title": "Infrarize — Choose Platform",
|
||||||
"description": "Select the type of device you want to control via IR.",
|
"description": "Select the type of device you want to control via IR.",
|
||||||
"data": {
|
"data": {
|
||||||
"platform": "Platform"
|
"platform": "Platform"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"controller_filter": {
|
"controller_filter": {
|
||||||
"title": "SmartIR — Filter by Controller",
|
"title": "Infrarize — Filter by Controller",
|
||||||
"description": "Narrow the device list to a specific controller type, or show all.",
|
"description": "Narrow the device list to a specific controller type, or show all.",
|
||||||
"data": {
|
"data": {
|
||||||
"controller_type": "Controller Type"
|
"controller_type": "Controller Type"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"manufacturer": {
|
"manufacturer": {
|
||||||
"title": "SmartIR — Select Manufacturer",
|
"title": "Infrarize — Select Manufacturer",
|
||||||
"description": "Choose your device manufacturer. Select **'Enter code manually'** if your device is not listed.",
|
"description": "Choose your device manufacturer. Select **'Enter code manually'** if your device is not listed.",
|
||||||
"data": {
|
"data": {
|
||||||
"manufacturer": "Manufacturer"
|
"manufacturer": "Manufacturer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"device_select": {
|
"device_select": {
|
||||||
"title": "SmartIR — Select Device",
|
"title": "Infrarize — Select Device",
|
||||||
"description": "Choose the device model for **{manufacturer}**. Each entry shows the numeric code and supported model names.",
|
"description": "Choose the device model for **{manufacturer}**. Each entry shows the numeric code and supported model names.",
|
||||||
"data": {
|
"data": {
|
||||||
"device_code": "Device"
|
"device_code": "Device"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"device_manual": {
|
"device_manual": {
|
||||||
"title": "SmartIR — Enter Device Code",
|
"title": "Infrarize — Enter Device Code",
|
||||||
"description": "Enter the numeric device code. The file will be loaded from local storage or downloaded from GitHub.",
|
"description": "Enter the numeric device code. The file will be loaded from local storage or downloaded from GitHub.",
|
||||||
"data": {
|
"data": {
|
||||||
"device_code": "Device Code"
|
"device_code": "Device Code"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"device_name": {
|
"device_name": {
|
||||||
"title": "SmartIR — Confirm Device Name",
|
"title": "Infrarize — Confirm Device Name",
|
||||||
"description": "**{manufacturer}** — {models}\nController: {controller_type} | Code: {device_code}\n\nEdit the name shown in Home Assistant.",
|
"description": "**{manufacturer}** — {models}\nController: {controller_type} | Code: {device_code}\n\nEdit the name shown in Home Assistant.",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "Device Name"
|
"name": "Device Name"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"controller": {
|
"controller": {
|
||||||
"title": "SmartIR — Controller Connection",
|
"title": "Infrarize — Controller Connection",
|
||||||
"description": "Controller type: **{controller_type}**\n\n{controller_hint}",
|
"description": "Controller type: **{controller_type}**\n\n{controller_hint}",
|
||||||
"data": {
|
"data": {
|
||||||
"controller_data": "Controller Data",
|
"controller_data": "Controller Data",
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"options_platform": {
|
"options_platform": {
|
||||||
"title": "SmartIR — Optional Settings",
|
"title": "Infrarize — Optional Settings",
|
||||||
"description": "**{manufacturer}** — {models}\nController: {controller_type}\n\nAll fields below are optional.",
|
"description": "**{manufacturer}** — {models}\nController: {controller_type}\n\nAll fields below are optional.",
|
||||||
"data": {
|
"data": {
|
||||||
"temperature_sensor": "Temperature Sensor",
|
"temperature_sensor": "Temperature Sensor",
|
||||||
@@ -70,13 +70,13 @@
|
|||||||
"unknown": "Unexpected error — check the Home Assistant logs."
|
"unknown": "Unexpected error — check the Home Assistant logs."
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"already_configured": "A SmartIR device with this code and controller is already configured."
|
"already_configured": "A Infrarize device with this code and controller is already configured."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"step": {
|
"step": {
|
||||||
"controller": {
|
"controller": {
|
||||||
"title": "SmartIR — Edit Controller",
|
"title": "Infrarize — Edit Controller",
|
||||||
"description": "Controller type: **{controller_type}**\n\n{controller_hint}",
|
"description": "Controller type: **{controller_type}**\n\n{controller_hint}",
|
||||||
"data": {
|
"data": {
|
||||||
"controller_data": "Controller Data",
|
"controller_data": "Controller Data",
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"options_platform": {
|
"options_platform": {
|
||||||
"title": "SmartIR — Edit Optional Settings",
|
"title": "Infrarize — Edit Optional Settings",
|
||||||
"description": "**{manufacturer}** — {models}\nController: {controller_type}",
|
"description": "**{manufacturer}** — {models}\nController: {controller_type}",
|
||||||
"data": {
|
"data": {
|
||||||
"temperature_sensor": "Temperature Sensor",
|
"temperature_sensor": "Temperature Sensor",
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
check_updates:
|
|
||||||
description: Check for SmartIR updates.
|
|
||||||
update_component:
|
|
||||||
description: Update SmartIR component.
|
|
||||||
+12
-12
@@ -1,9 +1,9 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="#"><img src="assets/smartir_climate.png" width="350" alt="SmartIR Climate"></a>
|
<a href="#"><img src="assets/infrarize_climate.png" width="350" alt="Infrarize Climate"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
For this platform to work, we need a .json file containing all the necessary IR commands.
|
For this platform to work, we need a .json file containing all the necessary IR commands.
|
||||||
Find your device's brand code [here](CLIMATE.md#available-codes-for-climate-devices) and add the number in the `device_code` field. If your device is not working, you will need to learn your own codes and place the Json file in `smartir/codes/climate` subfolders. ~~[Keite Trần](https://github.com/keitetran/BroadlinkIRTools) developed [an amazing web-based app](https://keitetran.github.io/BroadlinkIRTools/) for this job.~~
|
Find your device's brand code [here](CLIMATE.md#available-codes-for-climate-devices) and add the number in the `device_code` field. If your device is not working, you will need to learn your own codes and place the Json file in `infrarize/codes/climate` subfolders. ~~[Keite Trần](https://github.com/keitetran/BroadlinkIRTools) developed [an amazing web-based app](https://keitetran.github.io/BroadlinkIRTools/) for this job.~~
|
||||||
_Please note that the device_code field only accepts positive numbers. The .json extension is not required._
|
_Please note that the device_code field only accepts positive numbers. The .json extension is not required._
|
||||||
|
|
||||||
## Configuration variables:
|
## Configuration variables:
|
||||||
@@ -23,10 +23,10 @@ _Please note that the device_code field only accepts positive numbers. The .json
|
|||||||
Add a Broadlink RM device named "Bedroom" via config flow (read the [docs](https://www.home-assistant.io/integrations/broadlink/)).
|
Add a Broadlink RM device named "Bedroom" via config flow (read the [docs](https://www.home-assistant.io/integrations/broadlink/)).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
climate:
|
climate:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Office AC
|
name: Office AC
|
||||||
unique_id: office_ac
|
unique_id: office_ac
|
||||||
device_code: 1000
|
device_code: 1000
|
||||||
@@ -38,7 +38,7 @@ climate:
|
|||||||
|
|
||||||
## Example (using xiaomi controller):
|
## Example (using xiaomi controller):
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
remote:
|
remote:
|
||||||
- platform: xiaomi_miio
|
- platform: xiaomi_miio
|
||||||
@@ -46,7 +46,7 @@ remote:
|
|||||||
token: YOUR_TOKEN
|
token: YOUR_TOKEN
|
||||||
|
|
||||||
climate:
|
climate:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Office AC
|
name: Office AC
|
||||||
unique_id: office_ac
|
unique_id: office_ac
|
||||||
device_code: 2000
|
device_code: 2000
|
||||||
@@ -58,10 +58,10 @@ climate:
|
|||||||
|
|
||||||
## Example (using mqtt controller):
|
## Example (using mqtt controller):
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
climate:
|
climate:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Office AC
|
name: Office AC
|
||||||
unique_id: office_ac
|
unique_id: office_ac
|
||||||
device_code: 3000
|
device_code: 3000
|
||||||
@@ -74,10 +74,10 @@ climate:
|
|||||||
|
|
||||||
## Example (using LOOKin controller):
|
## Example (using LOOKin controller):
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
climate:
|
climate:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Office AC
|
name: Office AC
|
||||||
unique_id: office_ac
|
unique_id: office_ac
|
||||||
device_code: 4000
|
device_code: 4000
|
||||||
@@ -110,10 +110,10 @@ remote_transmitter:
|
|||||||
```
|
```
|
||||||
HA configuration.yaml:
|
HA configuration.yaml:
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
climate:
|
climate:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Office AC
|
name: Office AC
|
||||||
unique_id: office_ac
|
unique_id: office_ac
|
||||||
device_code: 8000
|
device_code: 8000
|
||||||
|
|||||||
+12
-12
@@ -1,9 +1,9 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="#"><img src="assets/smartir_fan.png" width="350" alt="SmartIR Media Player"></a>
|
<a href="#"><img src="assets/infrarize_fan.png" width="350" alt="Infrarize Media Player"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
For this platform to work, we need a .json file containing all the necessary IR or RF commands.
|
For this platform to work, we need a .json file containing all the necessary IR or RF commands.
|
||||||
Find your device's brand code [here](FAN.md#available-codes-for-fan-devices) and add the number in the `device_code` field. The compoenent will download it to the correct folder. If your device is not working, you will need to learn your own codes and place the .json file in `smartir/codes/fan/` subfolders. Please note that the `device_code` field only accepts positive numbers. The .json extension is not required.
|
Find your device's brand code [here](FAN.md#available-codes-for-fan-devices) and add the number in the `device_code` field. The compoenent will download it to the correct folder. If your device is not working, you will need to learn your own codes and place the .json file in `infrarize/codes/fan/` subfolders. Please note that the `device_code` field only accepts positive numbers. The .json extension is not required.
|
||||||
|
|
||||||
## Configuration variables
|
## Configuration variables
|
||||||
|
|
||||||
@@ -19,10 +19,10 @@ Find your device's brand code [here](FAN.md#available-codes-for-fan-devices) and
|
|||||||
Add a Broadlink RM device named "Bedroom" via config flow (read the [docs](https://www.home-assistant.io/integrations/broadlink/)).
|
Add a Broadlink RM device named "Bedroom" via config flow (read the [docs](https://www.home-assistant.io/integrations/broadlink/)).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
fan:
|
fan:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Bedroom fan
|
name: Bedroom fan
|
||||||
unique_id: bedroom_fan
|
unique_id: bedroom_fan
|
||||||
device_code: 1000
|
device_code: 1000
|
||||||
@@ -33,7 +33,7 @@ fan:
|
|||||||
## Example (using xiaomi controller)
|
## Example (using xiaomi controller)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
remote:
|
remote:
|
||||||
- platform: xiaomi_miio
|
- platform: xiaomi_miio
|
||||||
@@ -41,7 +41,7 @@ remote:
|
|||||||
token: YOUR_TOKEN
|
token: YOUR_TOKEN
|
||||||
|
|
||||||
fan:
|
fan:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Bedroom fan
|
name: Bedroom fan
|
||||||
unique_id: bedroom_fan
|
unique_id: bedroom_fan
|
||||||
device_code: 2000
|
device_code: 2000
|
||||||
@@ -52,10 +52,10 @@ fan:
|
|||||||
## Example (using mqtt controller)
|
## Example (using mqtt controller)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
fan:
|
fan:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Bedroom fan
|
name: Bedroom fan
|
||||||
unique_id: bedroom_fan
|
unique_id: bedroom_fan
|
||||||
device_code: 3000
|
device_code: 3000
|
||||||
@@ -66,10 +66,10 @@ fan:
|
|||||||
## Example (using LOOKin controller)
|
## Example (using LOOKin controller)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
fan:
|
fan:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Bedroom fan
|
name: Bedroom fan
|
||||||
unique_id: bedroom_fan
|
unique_id: bedroom_fan
|
||||||
device_code: 4000
|
device_code: 4000
|
||||||
@@ -104,10 +104,10 @@ remote_transmitter:
|
|||||||
HA configuration.yaml:
|
HA configuration.yaml:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
fan:
|
fan:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Bedroom fan
|
name: Bedroom fan
|
||||||
unique_id: bedroom_fan
|
unique_id: bedroom_fan
|
||||||
device_code: 4000
|
device_code: 4000
|
||||||
|
|||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="#"><img src="assets/smartir_light.png" width="350" alt="SmartIR light"></a>
|
<a href="#"><img src="assets/infrarize_light.png" width="350" alt="Infrarize light"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
For this platform to work, we need a .json file containing all the necessary IR or RF commands.
|
For this platform to work, we need a .json file containing all the necessary IR or RF commands.
|
||||||
Find your device's brand code [here](LIGHT.md#available-codes-for-light-devices) and add the number in the `device_code` field. The component will download it to the correct folder. If your device is not working, you will need to learn your own codes and place the .json file in `smartir/codes/light` subfolders. Please note that the `device_code` field only accepts positive numbers. The .json extension is not required.
|
Find your device's brand code [here](LIGHT.md#available-codes-for-light-devices) and add the number in the `device_code` field. The component will download it to the correct folder. If your device is not working, you will need to learn your own codes and place the .json file in `infrarize/codes/light` subfolders. Please note that the `device_code` field only accepts positive numbers. The .json extension is not required.
|
||||||
|
|
||||||
## Configuration variables
|
## Configuration variables
|
||||||
|
|
||||||
@@ -19,10 +19,10 @@ Find your device's brand code [here](LIGHT.md#available-codes-for-light-devices)
|
|||||||
Add a Broadlink RM device named "Bedroom" via config flow (read the [docs](https://www.homeassistant.io/integrations/broadlink/)).
|
Add a Broadlink RM device named "Bedroom" via config flow (read the [docs](https://www.homeassistant.io/integrations/broadlink/)).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
light:
|
light:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Bedroom Ceiling Light
|
name: Bedroom Ceiling Light
|
||||||
unique_id: bedroom_ceiling_light
|
unique_id: bedroom_ceiling_light
|
||||||
device_code: 1000
|
device_code: 1000
|
||||||
|
|||||||
+14
-14
@@ -1,9 +1,9 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="#"><img src="assets/smartir_mediaplayer.png" width="350" alt="SmartIR Media Player"></a>
|
<a href="#"><img src="assets/infrarize_mediaplayer.png" width="350" alt="Infrarize Media Player"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
For this platform to work, we need a .json file containing all the necessary IR commands.
|
For this platform to work, we need a .json file containing all the necessary IR commands.
|
||||||
Find your device's brand code [here](MEDIA_PLAYER.md#available-codes-for-tv-devices) and add the number in the `device_code` field. The component will download it to the correct folder. If your device is not working, you will need to learn your own codes and place the .json file in `smartir/codes/media_player/` subfolders. Please note that the `device_code` field only accepts positive numbers. The .json extension is not required.
|
Find your device's brand code [here](MEDIA_PLAYER.md#available-codes-for-tv-devices) and add the number in the `device_code` field. The component will download it to the correct folder. If your device is not working, you will need to learn your own codes and place the .json file in `infrarize/codes/media_player/` subfolders. Please note that the `device_code` field only accepts positive numbers. The .json extension is not required.
|
||||||
|
|
||||||
## Configuration variables:
|
## Configuration variables:
|
||||||
**name** (Optional): The name of the device<br />
|
**name** (Optional): The name of the device<br />
|
||||||
@@ -18,10 +18,10 @@ Find your device's brand code [here](MEDIA_PLAYER.md#available-codes-for-tv-devi
|
|||||||
Add a Broadlink RM device named "Bedroom" via config flow (read the [docs](https://www.home-assistant.io/integrations/broadlink/)).
|
Add a Broadlink RM device named "Bedroom" via config flow (read the [docs](https://www.home-assistant.io/integrations/broadlink/)).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
media_player:
|
media_player:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Living room TV
|
name: Living room TV
|
||||||
unique_id: living_room_tv
|
unique_id: living_room_tv
|
||||||
device_code: 1000
|
device_code: 1000
|
||||||
@@ -31,7 +31,7 @@ media_player:
|
|||||||
|
|
||||||
## Example (using xiaomi controller):
|
## Example (using xiaomi controller):
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
remote:
|
remote:
|
||||||
- platform: xiaomi_miio
|
- platform: xiaomi_miio
|
||||||
@@ -39,7 +39,7 @@ remote:
|
|||||||
token: YOUR_TOKEN
|
token: YOUR_TOKEN
|
||||||
|
|
||||||
media_player:
|
media_player:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Living room TV
|
name: Living room TV
|
||||||
unique_id: living_room_tv
|
unique_id: living_room_tv
|
||||||
device_code: 2000
|
device_code: 2000
|
||||||
@@ -49,10 +49,10 @@ media_player:
|
|||||||
|
|
||||||
## Example (using mqtt controller):
|
## Example (using mqtt controller):
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
media_player:
|
media_player:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Living room TV
|
name: Living room TV
|
||||||
unique_id: living_room_tv
|
unique_id: living_room_tv
|
||||||
device_code: 3000
|
device_code: 3000
|
||||||
@@ -62,10 +62,10 @@ media_player:
|
|||||||
|
|
||||||
## Example (using LOOKin controller):
|
## Example (using LOOKin controller):
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
media_player:
|
media_player:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Living room TV
|
name: Living room TV
|
||||||
unique_id: living_room_tv
|
unique_id: living_room_tv
|
||||||
device_code: 4000
|
device_code: 4000
|
||||||
@@ -96,10 +96,10 @@ remote_transmitter:
|
|||||||
```
|
```
|
||||||
HA configuration.yaml:
|
HA configuration.yaml:
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
|
|
||||||
media_player:
|
media_player:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Living room TV
|
name: Living room TV
|
||||||
unique_id: living_room_tv
|
unique_id: living_room_tv
|
||||||
device_code: 2000
|
device_code: 2000
|
||||||
@@ -112,7 +112,7 @@ Source names in device files are usually set to the name that the media player u
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
media_player:
|
media_player:
|
||||||
- platform: smartir
|
- platform: infrarize
|
||||||
name: Living room TV
|
name: Living room TV
|
||||||
unique_id: living_room_tv
|
unique_id: living_room_tv
|
||||||
device_code: 1000
|
device_code: 1000
|
||||||
@@ -124,7 +124,7 @@ media_player:
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Changing channels
|
### Changing channels
|
||||||
Most IR remotes can only send one key at a time (0 to 9) to change your TV channel, changing to other channels requires pressing 2 consecutive keys. SmartIR handles any channel for you with the standard Home Assistant service interface. Here is an example that changes your Kitchen TV to channel 51:
|
Most IR remotes can only send one key at a time (0 to 9) to change your TV channel, changing to other channels requires pressing 2 consecutive keys. Infrarize handles any channel for you with the standard Home Assistant service interface. Here is an example that changes your Kitchen TV to channel 51:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
service: media_player.play_media
|
service: media_player.play_media
|
||||||
|
|||||||
+14
-16
@@ -1,15 +1,13 @@
|
|||||||
[](https://github.com/kobimx/SmartIR/releases/latest) [](https://github.com/custom-components/hacs)
|
[](https://github.com/kobimx/Infrarize/releases/latest) [](https://github.com/custom-components/hacs)
|
||||||
|
|
||||||
> ### ⚠️ Warning
|
> ### ⚠️ Notice
|
||||||
> You are free to fork, modify, and use the code in this repository in accordance with the applicable open-source license.
|
> This project is a fork of [SmartIR](https://github.com/smartHomeHub/SmartIR), rebranded as **Infrarize** in compliance with the original project's guideline that its name not be used for forks or derivative works.
|
||||||
>
|
>
|
||||||
> **However, the name "SmartIR" must not be used in any capacity**, especially for promoting, rebranding, or distributing your own fork or derivative works.
|
> Full credit to the original SmartIR authors and community for the underlying design and device code database.
|
||||||
>
|
|
||||||
> Please respect this guideline to preserve the original project's identity.
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
SmartIR is a custom integration for controlling **climate devices**, **media players**, **fans** and **lights** via infrared controllers.<br>
|
Infrarize is a custom integration for controlling **climate devices**, **media players**, **fans** and **lights** via infrared controllers.<br>
|
||||||
SmartIR currently supports the following controllers:
|
Infrarize currently supports the following controllers:
|
||||||
* [Broadlink](https://www.home-assistant.io/integrations/broadlink/)
|
* [Broadlink](https://www.home-assistant.io/integrations/broadlink/)
|
||||||
* [Xiaomi IR Remote (ChuangmiIr)](https://www.home-assistant.io/integrations/remote.xiaomi_miio/)
|
* [Xiaomi IR Remote (ChuangmiIr)](https://www.home-assistant.io/integrations/remote.xiaomi_miio/)
|
||||||
* [LOOK.in Remote](http://look-in.club/devices/remote)
|
* [LOOK.in Remote](http://look-in.club/devices/remote)
|
||||||
@@ -27,7 +25,7 @@ It should look similar to this:
|
|||||||
```
|
```
|
||||||
<config directory>/
|
<config directory>/
|
||||||
|-- custom_components/
|
|-- custom_components/
|
||||||
| |-- smartir/
|
| |-- infrarize/
|
||||||
| |-- __init__.py
|
| |-- __init__.py
|
||||||
| |-- climate.py
|
| |-- climate.py
|
||||||
| |-- fan.py
|
| |-- fan.py
|
||||||
@@ -37,25 +35,25 @@ It should look similar to this:
|
|||||||
```
|
```
|
||||||
**(2)** Add the following to your configuration.yaml file.
|
**(2)** Add the following to your configuration.yaml file.
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
```
|
```
|
||||||
|
|
||||||
SmartIR automatically detects updates after each HA startup and asks you to install them. It also has a mechanism that prevents you from updating if the last SmartIR version is incompatible with your HA instance. You can disable this feature by setting SmartIR as follows:
|
Infrarize automatically detects updates after each HA startup and asks you to install them. It also has a mechanism that prevents you from updating if the last Infrarize version is incompatible with your HA instance. You can disable this feature by setting Infrarize as follows:
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
check_updates: false
|
check_updates: false
|
||||||
```
|
```
|
||||||
|
|
||||||
If you would like to get updates from the rc branch (Release Candidate), configure SmartIR as follows:
|
If you would like to get updates from the rc branch (Release Candidate), configure Infrarize as follows:
|
||||||
```yaml
|
```yaml
|
||||||
smartir:
|
infrarize:
|
||||||
update_branch: rc
|
update_branch: rc
|
||||||
```
|
```
|
||||||
|
|
||||||
**(3)** Configure a platform.
|
**(3)** Configure a platform.
|
||||||
|
|
||||||
### *HACS*
|
### *HACS*
|
||||||
If you want HACS to handle installation and updates, add SmartIR as a [custom repository](https://hacs.xyz/docs/faq/custom_repositories/). In this case, it is recommended that you turn off automatic updates, as above.
|
If you want HACS to handle installation and updates, add Infrarize as a [custom repository](https://hacs.xyz/docs/faq/custom_repositories/). In this case, it is recommended that you turn off automatic updates, as above.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|
||||||
@@ -68,4 +66,4 @@ Click on the links below for instructions on how to configure each platform.
|
|||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
## See also
|
## See also
|
||||||
* [Discussion about SmartIR Climate (Home Assistant Community)](https://community.home-assistant.io/t/smartir-control-your-climate-tv-and-fan-devices-via-ir-rf-controllers/)
|
* [Discussion about the original SmartIR project (Home Assistant Community)](https://community.home-assistant.io/t/smartir-control-your-climate-tv-and-fan-devices-via-ir-rf-controllers/) — useful background on climate/TV/fan IR control patterns; not specific to this fork.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "SmartIR",
|
"name": "Infrarize",
|
||||||
"homeassistant": "2025.5.0",
|
"homeassistant": "2025.5.0",
|
||||||
"persistent_directory": "codes"
|
"persistent_directory": "codes"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
Run from the repo root:
|
Run from the repo root:
|
||||||
python tools/build_index.py
|
python tools/build_index.py
|
||||||
|
|
||||||
Outputs: custom_components/smartir/codes_index.json
|
Outputs: custom_components/infrarize/codes_index.json
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
@@ -16,7 +16,7 @@ _TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
|
|||||||
REPO_ROOT = os.path.dirname(_TOOLS_DIR)
|
REPO_ROOT = os.path.dirname(_TOOLS_DIR)
|
||||||
CODES_DIR = os.path.join(REPO_ROOT, "codes")
|
CODES_DIR = os.path.join(REPO_ROOT, "codes")
|
||||||
OUTPUT_FILE = os.path.join(
|
OUTPUT_FILE = os.path.join(
|
||||||
REPO_ROOT, "custom_components", "smartir", "codes_index.json"
|
REPO_ROOT, "custom_components", "infrarize", "codes_index.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
SmartIR IR Code Capture Tool
|
Infrarize IR Code Capture Tool
|
||||||
Captures IR codes via zigbee2mqtt (iH-F8260) and builds SmartIR-compatible JSON files.
|
Captures IR codes via zigbee2mqtt (iH-F8260) and builds Infrarize-compatible JSON files.
|
||||||
|
|
||||||
Requires: paho-mqtt (pip install paho-mqtt)
|
Requires: paho-mqtt (pip install paho-mqtt)
|
||||||
"""
|
"""
|
||||||
@@ -36,7 +36,7 @@ _SKIPPED = "__skipped__"
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
def gen_temps(min_t: float, max_t: float, precision: float) -> list:
|
def gen_temps(min_t: float, max_t: float, precision: float) -> list:
|
||||||
"""Generate temperature key strings matching SmartIR JSON format."""
|
"""Generate temperature key strings matching Infrarize JSON format."""
|
||||||
temps = []
|
temps = []
|
||||||
t = min_t
|
t = min_t
|
||||||
while round(t, 6) <= round(max_t, 6):
|
while round(t, 6) <= round(max_t, 6):
|
||||||
@@ -132,11 +132,11 @@ class _Tooltip:
|
|||||||
# Main App
|
# Main App
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
class SmartIRCapture(tk.Tk):
|
class InfrarizeCapture(tk.Tk):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.title("SmartIR IR Code Capture")
|
self.title("Infrarize IR Code Capture")
|
||||||
self.geometry("960x700")
|
self.geometry("960x700")
|
||||||
self.minsize(820, 600)
|
self.minsize(820, 600)
|
||||||
|
|
||||||
@@ -252,8 +252,8 @@ class SmartIRCapture(tk.Tk):
|
|||||||
"fan_modes": (
|
"fan_modes": (
|
||||||
"Fan Modes",
|
"Fan Modes",
|
||||||
"Free-form strings — use any names your remote supports.\n"
|
"Free-form strings — use any names your remote supports.\n"
|
||||||
"SmartIR passes them through as-is to Home Assistant.\n\n"
|
"Infrarize passes them through as-is to Home Assistant.\n\n"
|
||||||
"Common values used in existing SmartIR codes:\n"
|
"Common values used in existing Infrarize codes:\n"
|
||||||
" auto — Automatic fan speed\n"
|
" auto — Automatic fan speed\n"
|
||||||
" quiet — Quiet / silent\n"
|
" quiet — Quiet / silent\n"
|
||||||
" low — Low speed\n"
|
" low — Low speed\n"
|
||||||
@@ -268,8 +268,8 @@ class SmartIRCapture(tk.Tk):
|
|||||||
"swing_modes": (
|
"swing_modes": (
|
||||||
"Swing Modes",
|
"Swing Modes",
|
||||||
"Free-form strings — optional. Leave empty if your remote has no swing.\n"
|
"Free-form strings — optional. Leave empty if your remote has no swing.\n"
|
||||||
"SmartIR passes them through as-is to Home Assistant.\n\n"
|
"Infrarize passes them through as-is to Home Assistant.\n\n"
|
||||||
"Common values used in existing SmartIR codes:\n"
|
"Common values used in existing Infrarize codes:\n"
|
||||||
" auto — Automatic swing\n"
|
" auto — Automatic swing\n"
|
||||||
" swing — Continuous swing\n"
|
" swing — Continuous swing\n"
|
||||||
" horizontal — Horizontal vane only\n"
|
" horizontal — Horizontal vane only\n"
|
||||||
@@ -894,7 +894,7 @@ class SmartIRCapture(tk.Tk):
|
|||||||
combo = self._current_combo()
|
combo = self._current_combo()
|
||||||
if not combo or not self.pending_code:
|
if not combo or not self.pending_code:
|
||||||
return
|
return
|
||||||
# SmartIR MQTT controller publishes the command string verbatim as payload.
|
# Infrarize MQTT controller publishes the command string verbatim as payload.
|
||||||
# zigbee2mqtt expects {"ir_code_to_send": "..."} on the /set topic.
|
# zigbee2mqtt expects {"ir_code_to_send": "..."} on the /set topic.
|
||||||
stored = json.dumps({"ir_code_to_send": self.pending_code})
|
stored = json.dumps({"ir_code_to_send": self.pending_code})
|
||||||
self.session.setdefault("codes", {})[combo_key(combo)] = stored
|
self.session.setdefault("codes", {})[combo_key(combo)] = stored
|
||||||
@@ -1082,7 +1082,7 @@ class SmartIRCapture(tk.Tk):
|
|||||||
def _browse_export_path(self):
|
def _browse_export_path(self):
|
||||||
initial = CODES_DIR if CODES_DIR.exists() else TOOLS_DIR.parent
|
initial = CODES_DIR if CODES_DIR.exists() else TOOLS_DIR.parent
|
||||||
path = filedialog.asksaveasfilename(
|
path = filedialog.asksaveasfilename(
|
||||||
title="Export SmartIR JSON",
|
title="Export Infrarize JSON",
|
||||||
initialdir=initial,
|
initialdir=initial,
|
||||||
defaultextension=".json",
|
defaultextension=".json",
|
||||||
filetypes=[("JSON", "*.json")],
|
filetypes=[("JSON", "*.json")],
|
||||||
@@ -1237,7 +1237,7 @@ class SmartIRCapture(tk.Tk):
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
app = SmartIRCapture()
|
app = InfrarizeCapture()
|
||||||
app.mainloop()
|
app.mainloop()
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user