mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38:31 +00:00
ux v1.40.2: default speaker icon for smart speakers (Alice et al.)
- rules split: mdi:soundbar only for soundbars; колонки/станции/yandex/ alice/speaker -> mdi:speaker; +1 unit test (109)
This commit is contained in:
@@ -11,7 +11,7 @@ PLANS_DIR = "houseplan/plans" # relative to the HA configuration directory
|
|||||||
FILES_URL = "/houseplan_files/files"
|
FILES_URL = "/houseplan_files/files"
|
||||||
FILES_DIR = "houseplan/files"
|
FILES_DIR = "houseplan/files"
|
||||||
CONF_ADMIN_ONLY = "admin_only"
|
CONF_ADMIN_ONLY = "admin_only"
|
||||||
VERSION = "1.40.1"
|
VERSION = "1.40.2"
|
||||||
|
|
||||||
DEFAULT_CONFIG: dict = {
|
DEFAULT_CONFIG: dict = {
|
||||||
"spaces": [],
|
"spaces": [],
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -16,5 +16,5 @@
|
|||||||
"issue_tracker": "https://github.com/Matysh/houseplan-card/issues",
|
"issue_tracker": "https://github.com/Matysh/houseplan-card/issues",
|
||||||
"requirements": [],
|
"requirements": [],
|
||||||
"single_config_entry": true,
|
"single_config_entry": true,
|
||||||
"version": "1.40.1"
|
"version": "1.40.2"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
@@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.40.2 — 2026-07-24
|
||||||
|
- Default icon rules: smart speakers (Yandex/Alice stations, «колонка»,
|
||||||
|
generic speakers) now get **mdi:speaker**; mdi:soundbar stays for actual
|
||||||
|
soundbars. Applies where the icon rules haven't been customized.
|
||||||
|
|
||||||
## v1.40.1 — 2026-07-23
|
## v1.40.1 — 2026-07-23
|
||||||
- Rooms are no longer clickable in View (default cursor, empty space does
|
- Rooms are no longer clickable in View (default cursor, empty space does
|
||||||
nothing). Instead the room card shows a small **open-in-new icon** after
|
nothing). Instead the room card shows a small **open-in-new icon** after
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "houseplan-card",
|
"name": "houseplan-card",
|
||||||
"version": "1.40.1",
|
"version": "1.40.2",
|
||||||
"description": "Interactive house plan Lovelace card for Home Assistant",
|
"description": "Interactive house plan Lovelace card for Home Assistant",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import './space-card';
|
|||||||
import { cardStyles } from './styles';
|
import { cardStyles } from './styles';
|
||||||
import { langOf, t, type I18nKey } from './i18n';
|
import { langOf, t, type I18nKey } from './i18n';
|
||||||
|
|
||||||
const CARD_VERSION = '1.40.1';
|
const CARD_VERSION = '1.40.2';
|
||||||
const LS_KEY = 'houseplan_card_layout_v1';
|
const LS_KEY = 'houseplan_card_layout_v1';
|
||||||
const LS_CFG = 'houseplan_card_cfg_v1'; // cache of the server config+layout for instant rendering
|
const LS_CFG = 'houseplan_card_cfg_v1'; // cache of the server config+layout for instant rendering
|
||||||
const LS_ZOOM = 'houseplan_card_zoom_v1';
|
const LS_ZOOM = 'houseplan_card_zoom_v1';
|
||||||
|
|||||||
+2
-1
@@ -46,7 +46,8 @@ export const DEFAULT_ICON_RULES: IconRule[] = [
|
|||||||
{ pattern: 'стиральн|washer|washing', icon: 'mdi:washing-machine' },
|
{ pattern: 'стиральн|washer|washing', icon: 'mdi:washing-machine' },
|
||||||
{ pattern: 'сушилк|dryer', icon: 'mdi:tumble-dryer' },
|
{ pattern: 'сушилк|dryer', icon: 'mdi:tumble-dryer' },
|
||||||
{ pattern: 'пылесос|vacuum|dreame|roborock', icon: 'mdi:robot-vacuum' },
|
{ pattern: 'пылесос|vacuum|dreame|roborock', icon: 'mdi:robot-vacuum' },
|
||||||
{ pattern: 'soundbar|колонк|станц|speaker', icon: 'mdi:soundbar' },
|
{ pattern: 'soundbar', icon: 'mdi:soundbar' },
|
||||||
|
{ pattern: 'колонк|станц|speaker|яндекс|yandex|алиса|alice', icon: 'mdi:speaker' },
|
||||||
{ pattern: 'tv|телевизор|hyundaitv|mitv|television', icon: 'mdi:television' },
|
{ pattern: 'tv|телевизор|hyundaitv|mitv|television', icon: 'mdi:television' },
|
||||||
{ pattern: 'keenetic|роутер|router|mesh|access point', icon: 'mdi:router-wireless' },
|
{ pattern: 'keenetic|роутер|router|mesh|access point', icon: 'mdi:router-wireless' },
|
||||||
{ pattern: 'ибп|ups|kirpich', icon: 'mdi:battery-charging-high' },
|
{ pattern: 'ибп|ups|kirpich', icon: 'mdi:battery-charging-high' },
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import test from 'node:test';
|
import test from 'node:test';
|
||||||
import assert from 'node:assert/strict';
|
import assert from 'node:assert/strict';
|
||||||
import { buildDevices, lightGroups, primaryEntity, lqiFor, tempFor, humFor, areaLights, areaTemp, areaHum, areaLightStats } from '../test-build/devices.js';
|
import { buildDevices, lightGroups, primaryEntity, lqiFor, tempFor, humFor, areaLights, areaTemp, areaHum, areaLightStats } from '../test-build/devices.js';
|
||||||
import { compileIconRules } from '../test-build/rules.js';
|
import { compileIconRules, iconFor } from '../test-build/rules.js';
|
||||||
|
|
||||||
/** Minimal fake hass around the pieces buildDevices reads. */
|
/** Minimal fake hass around the pieces buildDevices reads. */
|
||||||
function mkHass({ devices = {}, entities = {}, states = {}, areas = {} } = {}) {
|
function mkHass({ devices = {}, entities = {}, states = {}, areas = {} } = {}) {
|
||||||
@@ -330,3 +330,10 @@ test('primaryEntity: hidden light beats visible config switch (grouped lamps)',
|
|||||||
};
|
};
|
||||||
assert.equal(primaryEntity(hass2, ['light.a', 'light.b'], 'mdi:lightbulb'), 'light.b');
|
assert.equal(primaryEntity(hass2, ['light.a', 'light.b'], 'mdi:lightbulb'), 'light.b');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('icon rules: soundbars vs smart speakers (v1.40.2)', () => {
|
||||||
|
assert.equal(iconFor('Sony soundbar', ''), 'mdi:soundbar');
|
||||||
|
assert.equal(iconFor('Яндекс Станция Мини', ''), 'mdi:speaker');
|
||||||
|
assert.equal(iconFor('Колонка Алисы', ''), 'mdi:speaker');
|
||||||
|
assert.equal(iconFor('Kitchen speaker', ''), 'mdi:speaker');
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user