Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
should fix config flow UI
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveicedgreentea committed Mar 12, 2024
1 parent c6d4ebb commit 86888ae
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
1 change: 0 additions & 1 deletion custom_components/jvc_projectors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ async def async_setup_entry(hass, entry):

timeout = entry.data.get(CONF_TIMEOUT, 3)
port = 20554
_LOGGER.debug(f"Setting up JVC Projector with host: {host}")
options = JVCInput(host, password, port, timeout)
# Create a coordinator or directly set up your entities with the provided information
coordinator = JVCProjectorCoordinator(options, _LOGGER)
Expand Down
14 changes: 4 additions & 10 deletions custom_components/jvc_projectors/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
CONF_PASSWORD,
CONF_TIMEOUT,
CONF_PASSWORD
)
import homeassistant.helpers.config_validation as cv
from jvc_projector.jvc_projector import JVCProjectorCoordinator, JVCInput

from .const import DOMAIN # Import the domain constant
Expand All @@ -28,7 +26,7 @@ async def async_step_user(self, user_input=None):
if user_input is not None:
host = user_input.get(CONF_HOST)
password = user_input.get(CONF_PASSWORD)
timeout = user_input.get(CONF_TIMEOUT, 3)
timeout = 5

valid = await self.validate_setup(host, password, timeout)

Expand All @@ -45,8 +43,7 @@ async def async_step_user(self, user_input=None):
{
vol.Required(CONF_NAME): str,
vol.Required(CONF_HOST): str,
vol.Optional(CONF_PASSWORD): str,
vol.Optional(CONF_TIMEOUT, default=3): int,
vol.Optional(CONF_PASSWORD): str
}
)

Expand Down Expand Up @@ -114,10 +111,7 @@ async def async_step_init(self, user_input=None):
vol.Optional(CONF_HOST, default=current_config.get(CONF_HOST)): str,
vol.Optional(
CONF_PASSWORD, default=current_config.get(CONF_PASSWORD)
): str,
vol.Optional(
CONF_TIMEOUT, default=current_config.get(CONF_TIMEOUT, 3)
): int,
): str
}
)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/jvc_projectors/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://github.com/iloveicedgreentea/jvc_homeassistant",
"requirements": [
"pyjvc==4.3.48"
"pyjvc==4.3.49"
],
"ssdp": [],
"zeroconf": [],
Expand Down
12 changes: 8 additions & 4 deletions custom_components/jvc_projectors/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
"user": {
"title": "Connect to your JVC Projector",
"data": {
"name": "Name",
"host": "Host",
"password": "Password",
"timeout": "Timeout"
"name": "[%key:common::config_flow::data::name%]",
"host": "[%key:common::config_flow::data::host%]",
"password": "[%key:common::config_flow::data::password%]"
},
"data_description": {
"name": "Name for your projector",
"host": "IP address or hostname of projector",
"password": "Optional password if NZ series or higher"
}
}
},
Expand Down

0 comments on commit 86888ae

Please sign in to comment.