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
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ All notable changes to this project are documented here. The format follows

## [Unreleased]

## [0.1.2] - 2026-10-30

### Fixed

- In a sections view the card is as high as its ports and trunks need; the trunks no longer
overlap the next card.
- In a narrow card (phones, three columns) the SFP ports move below the others instead of
covering the last ports; long device names no longer widen a port.

## [0.1.1] - 2026-10-30

### Changed
Expand All @@ -30,6 +39,7 @@ 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.1...HEAD
[Unreleased]: https://github.com/eizedev/managed-switch-card/compare/v0.1.2...HEAD
[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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "managed-switch-card",
"version": "0.1.1",
"version": "0.1.2",
"description": "Lovelace card that draws a managed switch's front panel from the Managed Switch (SNMP) Home Assistant integration",
"license": "MIT",
"private": true,
Expand Down
19 changes: 13 additions & 6 deletions src/managed-switch-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ export class ManagedSwitchCard extends LitElement {
return cardSize(layoutFor(reply, this._config?.layout), trunks);
}

getGridOptions(): Record<string, number> {
return { columns: 12, min_columns: 6, rows: 3 };
/** In a sections view: full width, as high as the ports and trunks need. */
getGridOptions(): Record<string, number | string> {
return { columns: 12, min_columns: 6, rows: "auto" };
}

protected override updated(changed: PropertyValues): void {
Expand Down Expand Up @@ -246,13 +247,15 @@ export class ManagedSwitchCard extends LitElement {
border-radius: 10px;
background: var(--secondary-background-color);
overflow-x: auto;
/* the SFP ports move below the others when the card is too narrow for both */
flex-wrap: wrap;
}
.rows {
display: flex;
flex-direction: column;
gap: 8px;
flex: 1 1 auto;
min-width: 0;
flex: 1 1 0;
min-width: min-content;
}
.row {
display: flex;
Expand Down Expand Up @@ -348,7 +351,10 @@ export class ManagedSwitchCard extends LitElement {
}
.name {
font-weight: 500;
max-width: 100%;
/* as wide as the port, however long the text: it does not widen the port */
width: 0;
min-width: 100%;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand All @@ -357,7 +363,8 @@ export class ManagedSwitchCard extends LitElement {
.rate {
color: var(--secondary-text-color);
text-align: center;
max-width: 100%;
width: 0;
min-width: 100%;
font-size: 0.9em;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
Loading