Limit actuator picker results
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.7.12 - 2026-06-16
|
||||||
|
- Aktor-Auswahlliste zeigt maximal 50 Treffer gleichzeitig und fordert bei
|
||||||
|
größeren Mengen zum Eingrenzen per Suche oder Typfilter auf.
|
||||||
|
|
||||||
## 0.7.11 - 2026-06-16
|
## 0.7.11 - 2026-06-16
|
||||||
- Aktor-Discovery erkennt weitere steuerbare HA-Domains wie Buttons, Helper,
|
- Aktor-Discovery erkennt weitere steuerbare HA-Domains wie Buttons, Helper,
|
||||||
Heizungen, Schlösser, Ventile und numerische Helper.
|
Heizungen, Schlösser, Ventile und numerische Helper.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: SillyHome Next
|
name: SillyHome Next
|
||||||
version: "0.7.11"
|
version: "0.7.12"
|
||||||
slug: sillyhome_next
|
slug: sillyhome_next
|
||||||
description: Lernt automatisch aus deinem Verhalten und steuert freigegebene Aktoren
|
description: Lernt automatisch aus deinem Verhalten und steuert freigegebene Aktoren
|
||||||
url: http://192.168.6.31:3000/pino/sillyhome-next
|
url: http://192.168.6.31:3000/pino/sillyhome-next
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
|
|||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="SillyHome Next API",
|
title="SillyHome Next API",
|
||||||
description="Lokales Smart-Home-Intelligenzsystem für Home Assistant.",
|
description="Lokales Smart-Home-Intelligenzsystem für Home Assistant.",
|
||||||
version="0.7.11",
|
version="0.7.12",
|
||||||
lifespan=lifespan,
|
lifespan=lifespan,
|
||||||
)
|
)
|
||||||
app.state.settings = load_settings()
|
app.state.settings = load_settings()
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ let currentActuatorId = null;
|
|||||||
let actuatorChoices = [];
|
let actuatorChoices = [];
|
||||||
let contextOptions = [];
|
let contextOptions = [];
|
||||||
let manualContextState = {options: [], selected: new Set()};
|
let manualContextState = {options: [], selected: new Set()};
|
||||||
|
const ACTUATOR_RESULT_LIMIT = 50;
|
||||||
|
|
||||||
async function api(path, options = {}) {
|
async function api(path, options = {}) {
|
||||||
const response = await fetch(path, {headers: {"Content-Type": "application/json"}, ...options});
|
const response = await fetch(path, {headers: {"Content-Type": "application/json"}, ...options});
|
||||||
@@ -349,14 +350,17 @@ function renderActuatorSelect() {
|
|||||||
const query = normalizedSearch(document.getElementById("actuator-search")?.value || "");
|
const query = normalizedSearch(document.getElementById("actuator-search")?.value || "");
|
||||||
const filtered = actuatorChoices
|
const filtered = actuatorChoices
|
||||||
.filter(entity => !domain || entity.domain === domain)
|
.filter(entity => !domain || entity.domain === domain)
|
||||||
.filter(entity => matchesSearch(entity, query))
|
.filter(entity => matchesSearch(entity, query));
|
||||||
.slice(0, 120);
|
const visible = filtered.slice(0, ACTUATOR_RESULT_LIMIT);
|
||||||
const domains = [...new Set(filtered.map(entity => entity.domain))].sort();
|
const domains = [...new Set(visible.map(entity => entity.domain))].sort();
|
||||||
|
const limitLabel = filtered.length > visible.length
|
||||||
|
? ` - ${visible.length} von ${filtered.length}; Suche oder Typ weiter eingrenzen`
|
||||||
|
: "";
|
||||||
select.innerHTML = [
|
select.innerHTML = [
|
||||||
`<option value="">${filtered.length ? "Gerät auswählen ..." : "Keine passenden Geräte gefunden"}</option>`,
|
`<option value="">${filtered.length ? `Gerät auswählen${limitLabel}` : "Keine passenden Geräte gefunden"}</option>`,
|
||||||
...domains.map(group => `
|
...domains.map(group => `
|
||||||
<optgroup label="${escapeHtml(actuatorGroupLabel(group))}">
|
<optgroup label="${escapeHtml(actuatorGroupLabel(group))}">
|
||||||
${filtered
|
${visible
|
||||||
.filter(entity => entity.domain === group)
|
.filter(entity => entity.domain === group)
|
||||||
.map(entity => `<option value="${escapeHtml(entity.entity_id)}">${escapeHtml(entityLabel(entity))}</option>`)
|
.map(entity => `<option value="${escapeHtml(entity.entity_id)}">${escapeHtml(entityLabel(entity))}</option>`)
|
||||||
.join("")}
|
.join("")}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "sillyhome-next"
|
name = "sillyhome-next"
|
||||||
version = "0.7.11"
|
version = "0.7.12"
|
||||||
description = "Lokales Smart-Home-Intelligenzsystem für Home Assistant"
|
description = "Lokales Smart-Home-Intelligenzsystem für Home Assistant"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
Reference in New Issue
Block a user