Launch stability fixes

This commit is contained in:
2022-07-28 13:48:37 +00:00
parent b211b7f884
commit a641617671
9 changed files with 526 additions and 407 deletions

View File

@@ -26,7 +26,9 @@ async def async_setup(hass, config):
async def async_setup_entry(hass, config_entry):
for domain in ["sensor", "binary_sensor", "light", "media_player", "camera"]:
await hass.config_entries.async_forward_entry_setup(config_entry, domain)
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, domain)
)
await async_setup_connection(hass)
await async_setup_view(hass)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,10 @@
import logging
from homeassistant import config_entries
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
@config_entries.HANDLERS.register(DOMAIN)
class BrowserModConfigFlow(config_entries.ConfigFlow):
@@ -11,4 +14,5 @@ class BrowserModConfigFlow(config_entries.ConfigFlow):
async def async_step_user(self, user_input=None):
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
return self.async_create_entry(title="", data={})
_LOGGER.error("Running async_create_entry")
return self.async_create_entry(title="Browser Mod", data={})

View File

@@ -5,7 +5,7 @@
"dependencies": ["panel_custom", "websocket_api", "http", "frontend", "lovelace"],
"codeowners": [],
"requirements": [],
"version": "2.0.0b1",
"version": "2.0.0b2",
"iot_class": "local_push",
"config_flow": true
}

View File

@@ -33,7 +33,10 @@ class BrowserSensor(BrowserModEntity, SensorEntity):
@property
def native_value(self):
return self._data.get("browser", {}).get(self.parameter, None)
val = self._data.get("browser", {}).get(self.parameter, None)
if len(str(val)) > 255:
val = str(val)[:250] + "..."
return val
@property
def device_class(self):