Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Nov 16, 2020
1 parent cdc8511 commit f889e01
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![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.1-blue.svg)
![version](https://img.shields.io/badge/VERSION-0.1.2-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)
Expand Down
19 changes: 11 additions & 8 deletions custom_components/ledfxrm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,17 @@ async def update(self):
return {'info':rest_info, 'devices': rest_devices, 'scenes': rest_scenes}

async def async_change_something(self, state):
if state is True:
logging.warning('Start Button will soon do: %s', self.thestart)
self.connected = True
return True
if state is False:
self.connected = False
logging.warning('Stop Button will soon do: %s', self.thestop)
return False
loop = asyncio.get_event_loop()
async with aiohttp.ClientSession(loop=loop, trust_env = True) as session:
if state is True:
async with session.get("http://" + self.thestart, ssl=False) as resp_start:
logging.debug('start: %s', resp_start)
return True
if state is False:
async with session.get("http://" + self.thestop, ssl=False) as resp_stop:
logging.debug('stop: %s', resp_stop)
return None


async def async_set_scene(self, effect):
if effect is None:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ledfxrm/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="command to start server"): str,
vol.Required(CONF_STOP, default="command to kill server"): str
vol.Required(CONF_START, default="192.168.1.56:1337/?ledfxstart"): str,
vol.Required(CONF_STOP, default="192.168.1.56:1337/?ledfxstop"): str
}
),
errors=self._errors,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ledfxrm/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
NAME = "LedFX ReMote"
DOMAIN = "ledfxrm"
DOMAIN_DATA = f"{DOMAIN}_data"
VERSION = "0.1.1"
VERSION = "0.1.2"
MANUFACTURER = "YeonV"

ISSUE_URL = "https://github.com/YeonV/ledfxrm/issues"
Expand Down
8 changes: 4 additions & 4 deletions custom_components/ledfxrm/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def unique_id(self):
return self.config_entry.entry_id + '_switch'

# Wait until one can change the Icon of the On/Off buttons
#@property
#def assumed_state(self):
# """Return the name of the switch."""
# return True
@property
def assumed_state(self):
"""Return the name of the switch."""
return True

@property
def name(self):
Expand Down
6 changes: 3 additions & 3 deletions custom_components/ledfxrm/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"step": {
"user": {
"title": "LedFX Remote - Setup",
"description": "Welcome\nPlease make sure you meet the requirements:\n- LedFX Server up and running\n- At lease one scene defined in LedFX\n- Change host in ledfx-confi-yaml from 127.0.0.1 to your IP\n (maybe 0.0.0.0 also work)\n alternativly you can start it with `ledfx --host 0.0.0.0`\n\nIf you need help with the configuration have a look here: https://github.com/YeonV/ledfxrm",
"description": "Welcome\nPlease make sure you meet the requirements:\n- LedFX Server >0.7 up and running\n- At lease one scene defined in LedFX\n- Change host in ledfx-confi-yaml from 127.0.0.1 to your IP\n (maybe 0.0.0.0 also work)\n alternativly you can start it with `ledfx --host 0.0.0.0`\n\nIf you need help with the configuration have a look here: https://github.com/YeonV/ledfxrm",
"data": {
"thehost": "192.168.1.56",
"theport": 8888,
"host": "Host",
"port": "Port",
"start": "NOT READY YET - just a log-dummy: Start Server",
"stop": "NOT READY YET - just a log-dummy: Kill Server",
"start": "GET Endpoint: Start Server",
"stop": "GET Endpoint: Kill Server",
"advanced": "Devmode"
}
}
Expand Down

0 comments on commit f889e01

Please sign in to comment.