Skip to content
This repository was archived by the owner on Nov 2, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ reads only: the integration's WebSocket command `managed_switch/ports` and entit
```sh
npm ci --ignore-scripts
npm run typecheck # tsc, strict
npm test # vitest
npm test # vitest with coverage (thresholds in vitest.config.ts)
npm run build # dist/managed-switch-card.js
```

## Rules that matter here

- **Logic in `src/model.ts`** as pure functions with tests in `test/`; `src/managed-switch-card.ts`
only renders. Entities are found through the integration's command, never by guessing entity
- **Logic in `src/model.ts`** (and loading in `src/loader.ts`) as pure functions with tests in
`test/`; `src/managed-switch-card.ts` only renders, tested in a browser stand-in (happy-dom,
`test/card.test.ts`). Entities are found through the integration's command, never by guessing entity
IDs (they follow the user's language).
- **Model layouts** go into `MODEL_LAYOUTS`, keyed by `sysObjectID`, only for models someone has
seen (CONTRIBUTING.md); everything else uses the automatic layout.
- **Texts** in English and German (`WORDS` in `src/model.ts`, labels in the editor).
- **Texts** in English and German (`WORDS` in `src/model.ts`, the editor's labels included).
- The card never calls a service or changes anything.
- **Screenshots** come from the integration's demo instance (`scripts/demo/screenshots.py --card`
in ha-managed-switch), never from a real network.
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ All notable changes to this project are documented here. The format follows

## [Unreleased]

## [0.2.0] - 2026-10-30

### Added

- The speed in each port with link (`1G`, `2.5G`, `100`, `10`), so its state does not rest on
colour alone; `show_speed: false` turns it off. The trunk mark sits next to it.
- Tests for the card and its settings dialog in a browser stand-in, with a minimum coverage.

## [0.1.2] - 2026-10-30

### Fixed
Expand Down Expand Up @@ -39,7 +47,8 @@ First release.
tries again after 15 seconds and reads the ports again once the switch is back; it says when
the integration is too old.

[Unreleased]: https://github.com/eizedev/managed-switch-card/compare/v0.1.2...HEAD
[Unreleased]: https://github.com/eizedev/managed-switch-card/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/eizedev/managed-switch-card/compare/v0.1.2...v0.2.0
[0.1.2]: https://github.com/eizedev/managed-switch-card/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/eizedev/managed-switch-card/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/eizedev/managed-switch-card/releases/tag/v0.1.0
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type: custom:managed-switch-card
device_id: 0123456789abcdef0123456789abcdef # the switch, chosen in the card's dialog
title: Hallway # optional, else the switch's name
show_names: true # device names under the ports (default)
show_speed: true # speed in the ports: 1G, 100, 10 (default)
show_rates: false # data rates; the integration's rate sensors must be on
layout: # optional: your own front panel, by port name
rows: [["1", "3", "5", "7"], ["2", "4", "6", "8"]]
Expand Down
Binary file modified assets/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading