From e9ca4d339022ae559d9de93277933dad7a0cc7a7 Mon Sep 17 00:00:00 2001 From: YeonV Date: Mon, 16 Nov 2020 03:45:44 +0100 Subject: [PATCH] v0.1.3 --- README.md | 4 ++-- custom_components/ledfxrm/__init__.py | 6 ++++++ custom_components/ledfxrm/config_flow.py | 4 ++-- custom_components/ledfxrm/const.py | 2 +- custom_components/ledfxrm/light.py | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 635c366..5e3dacd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # LedFX ReMote for HomeAssistant [![hacs_badge](https://img.shields.io/badge/HACS-Custom-blue.svg)](https://github.com/custom-components/hacs) -![state](https://img.shields.io/badge/STATE-alpha-blue.svg) -![version](https://img.shields.io/badge/VERSION-0.1.2-blue.svg) +![state](https://img.shields.io/badge/STATE-beta-blue.svg) +![version](https://img.shields.io/badge/VERSION-0.1.3-blue.svg) [![license](https://img.shields.io/badge/LICENSE-MIT-blue.svg)](https://github.com/YeonV/ledfxrm/blob/main/LICENSE) [![creator](https://img.shields.io/badge/CREATOR-Yeon-blue.svg)](https://github.com/YeonV) [![creator](https://img.shields.io/badge/a.k.a-Blade-blue.svg)](https://github.com/YeonV) diff --git a/custom_components/ledfxrm/__init__.py b/custom_components/ledfxrm/__init__.py index 0691cc0..7f010e7 100644 --- a/custom_components/ledfxrm/__init__.py +++ b/custom_components/ledfxrm/__init__.py @@ -16,6 +16,7 @@ DOMAIN, PLATFORMS, STARTUP_MESSAGE, + SWITCH ) SCAN_INTERVAL = timedelta(seconds=30) @@ -55,6 +56,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): for platform in PLATFORMS: if entry.options.get(platform, True): + if platform is SWITCH: + if thestart is None: + continue + if thestart == '192.168.1.56:1337/?ledfxstart': + continue coordinator.platforms.append(platform) hass.async_add_job( hass.config_entries.async_forward_entry_setup(entry, platform) diff --git a/custom_components/ledfxrm/config_flow.py b/custom_components/ledfxrm/config_flow.py index 43aa0a4..f75c8e9 100644 --- a/custom_components/ledfxrm/config_flow.py +++ b/custom_components/ledfxrm/config_flow.py @@ -56,8 +56,8 @@ async def _show_config_form(self, user_input): # pylint: disable=unused-argumen { vol.Required(CONF_HOST, default="192.168.1.56"): str, vol.Required(CONF_PORT, default=8888): int, - vol.Required(CONF_START, default="192.168.1.56:1337/?ledfxstart"): str, - vol.Required(CONF_STOP, default="192.168.1.56:1337/?ledfxstop"): str + vol.Optional(CONF_START, default="192.168.1.56:1337/?ledfxstart"): str, + vol.Optional(CONF_STOP, default="192.168.1.56:1337/?ledfxstop"): str } ), errors=self._errors, diff --git a/custom_components/ledfxrm/const.py b/custom_components/ledfxrm/const.py index 9a7dc79..20066f6 100644 --- a/custom_components/ledfxrm/const.py +++ b/custom_components/ledfxrm/const.py @@ -3,7 +3,7 @@ NAME = "LedFX ReMote" DOMAIN = "ledfxrm" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "0.1.2" +VERSION = "0.1.3" MANUFACTURER = "YeonV" ISSUE_URL = "https://github.com/YeonV/ledfxrm/issues" diff --git a/custom_components/ledfxrm/light.py b/custom_components/ledfxrm/light.py index 66e84c1..fb4dfa0 100644 --- a/custom_components/ledfxrm/light.py +++ b/custom_components/ledfxrm/light.py @@ -22,13 +22,13 @@ async def async_turn_on(self, **kwargs): # pylint: disable=unused-argument await self.coordinator.async_request_refresh() return True - await self.coordinator.api.async_change_something(True) + #await self.coordinator.api.async_change_something(True) await self.coordinator.async_request_refresh() async def async_turn_off(self, **kwargs): # pylint: disable=unused-argument """Turn off the switch.""" - await self.coordinator.api.async_change_something(False) + #await self.coordinator.api.async_change_something(False) await self.coordinator.async_request_refresh()