mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 03:54:17 +02:00
Home Assistant smart plug improvements:
- Add search parameter to /ha/entities endpoint for searching all entities - Replace entity dropdown with searchable combobox (type to filter) - Default shows switch/light/input_boolean; search queries all domains - Make all three energy sensor dropdowns searchable (Power, Energy Today, Total) - Each dropdown filters by entity_id or friendly_name - Shows entity details (name, id, state, unit) in dropdown options Fixes issue where HA plugs with non-standard entity naming couldn't find their related power/energy sensors.
This commit is contained in:
@@ -2211,8 +2211,10 @@ export const api = {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ url, token }),
|
||||
}),
|
||||
getHAEntities: () =>
|
||||
request<HAEntity[]>('/smart-plugs/ha/entities'),
|
||||
getHAEntities: (search?: string) => {
|
||||
const params = search ? `?search=${encodeURIComponent(search)}` : '';
|
||||
return request<HAEntity[]>(`/smart-plugs/ha/entities${params}`);
|
||||
},
|
||||
getHASensorEntities: () =>
|
||||
request<HASensorEntity[]>('/smart-plugs/ha/sensors'),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user