diff --git a/custom_components/bom_local/__init__.py b/custom_components/bom_local/__init__.py index 5e6ad35..2b652a9 100644 --- a/custom_components/bom_local/__init__.py +++ b/custom_components/bom_local/__init__.py @@ -66,6 +66,11 @@ async def _async_setup_integration(hass: HomeAssistant, service_url: str): "/local/community/bom_local/bom-local-card.js", hass.config.path("custom_components/bom_local/www/bom-local-card.js"), True + ), + StaticPathConfig( + "/local/community/bom_local/icon.png", + hass.config.path("custom_components/bom_local/icon.png"), + True ) ]) diff --git a/custom_components/bom_local/config_flow.py b/custom_components/bom_local/config_flow.py index a938970..378adb1 100644 --- a/custom_components/bom_local/config_flow.py +++ b/custom_components/bom_local/config_flow.py @@ -17,6 +17,10 @@ class BomLocalConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): async def async_step_user(self, user_input=None): """Handle the initial step.""" + # Check if YAML configuration already exists by checking if component is loaded + if DOMAIN in self.hass.config.components: + return self.async_abort(reason="already_configured") + errors = {} if user_input is not None: # We could validate the URL here by trying a fetch @@ -39,7 +43,7 @@ class BomLocalOptionsFlow(config_entries.OptionsFlow): """Handle options flow.""" def __init__(self, config_entry): - self.config_entry = config_entry + super().__init__(config_entry) async def async_step_init(self, user_input=None): """Manage the options.""" diff --git a/custom_components/bom_local/icon.png b/custom_components/bom_local/icon.png new file mode 100644 index 0000000..0eac2eb Binary files /dev/null and b/custom_components/bom_local/icon.png differ diff --git a/custom_components/bom_local/manifest.json b/custom_components/bom_local/manifest.json index fae947a..c81b1f5 100644 --- a/custom_components/bom_local/manifest.json +++ b/custom_components/bom_local/manifest.json @@ -3,8 +3,9 @@ "name": "BOM Local Radar", "codeowners": ["@alexhopeoconnor"], "config_flow": true, + "single_config_entry": true, "iot_class": "local_polling", - "version": "0.2.0", + "version": "0.3.0", "dependencies": ["http", "websocket_api"], "documentation": "https://github.com/alexhopeoconnor/bom-local-card", "issue_tracker": "https://github.com/alexhopeoconnor/bom-local-card/issues" diff --git a/custom_components/bom_local/www/bom-local-card.js b/custom_components/bom_local/www/bom-local-card.js index 6d8a159..b46f6bf 100644 --- a/custom_components/bom_local/www/bom-local-card.js +++ b/custom_components/bom_local/www/bom-local-card.js @@ -1073,7 +1073,7 @@ BomLocalRadarCardEditor = __decorate([ t$1('bom-local-card-editor') ], BomLocalRadarCardEditor); -const CARD_VERSION = '0.2.0'; +const CARD_VERSION = '0.3.0'; const DEFAULT_FRAME_INTERVAL = 2.0; // seconds const DEFAULT_RESTART_DELAY = 2000; // ms (pause before looping) const DEFAULT_REFRESH_INTERVAL = 30; // seconds @@ -1419,6 +1419,25 @@ const imageStyles = i$3 ` flex-direction: column; align-items: center; gap: 12px; + z-index: 10; + } + + .loading-icon { + width: 80px; + height: 80px; + animation: pulse 2s ease-in-out infinite; + opacity: 0.8; + } + + @keyframes pulse { + 0%, 100% { + opacity: 0.8; + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(1.05); + } } .loading-message { @@ -3267,6 +3286,7 @@ let BomLocalRadarCard = class BomLocalRadarCard extends i { ${this.isLoading ? x `