mirror of
https://github.com/GeorgeSG/lovelace-time-picker-card.git
synced 2026-11-02 03:08:45 +00:00
Add explicit return types to schema helpers
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1069a8e7e4
commit
547b34e85a
+4
-2
@@ -18,14 +18,16 @@ const NAME_TO_LABEL_MAP = {
|
||||
seconds: 'Seconds',
|
||||
};
|
||||
|
||||
type FormSchemaEntry = Record<string, unknown>;
|
||||
|
||||
// The entity_name selector, which lets users compose a name out of registry
|
||||
// parts, was added in HA 2025.11. Older versions fall back to a plain text field.
|
||||
const nameSchema = (hass: HomeAssistant) =>
|
||||
const nameSchema = (hass: HomeAssistant): FormSchemaEntry =>
|
||||
supportsEntityNameSelector(hass)
|
||||
? { name: 'name', selector: { entity_name: {} }, context: { entity: 'entity' } }
|
||||
: { name: 'name', selector: { text: {} } };
|
||||
|
||||
const schema = (hass: HomeAssistant) => [
|
||||
const schema = (hass: HomeAssistant): FormSchemaEntry[] => [
|
||||
{ name: 'entity', selector: { entity: { domain: 'input_datetime' } } },
|
||||
nameSchema(hass),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user