Repository navigation
Conversation
added 7 commits
November 4, 2026 13:02
window.floorplanStudio.registerPlugin({id, apiVersion, provides}) lets
third-party integrations contribute device sources, toolbar actions and
style defaults without integration-specific code in this repo:
- deviceSources: live fetch(ws)/offline parse providers shown in the
generic Devices modal (was the RAMSES modal). The bundled ramses
source registers through the same public API as the reference impl.
- actions: toolbar items emitting floorplan-studio:action CustomEvents
({pluginId, actionId, projectId, floorId, selection}) — documented,
bubbles+composed so they escape the card shadow root.
- iconMap / markerDefaults / stateRulePresets (role-bound): merged as
plugin < user opts < device hints; css injected once, re-attached to
the card's shadow root in HACS mode.
- apiVersion + ignored-unknown-provides-keys for independent versioning.
importProject() merges a project fragment in one undo step and
projects.* (active/list/get/save/remove/open) replace the direct
IndexedDB pokes integrations needed before. callWS() exposes the active
HA link; documented events: action / project-imported / plugins-changed.
Also: registry fallback now reads parent_device_id alongside via_device
(HA 2026.9 child devices), and devices carry suggested=false for
gateways instead of a hardcoded group check in the planner.
The editor ships zero integration-specific code — the plugin API is the contract, and integrations own their mapping in their own repo. Ramses Extras ships its provider as a Lovelace resource from floorplan_helper (wimpie70/ramses_extras), registered under the same plugin id so it supersedes nothing and is versioned with the integration it talks to. src/examples/mqtt.ts is the new bundled reference implementation: entity-registry platform filter → device grouping → neutral ImportDevice shape. It is deliberately generic — change PLATFORM and it is a zwave/zigbee/ble source. haimport's WsCall/liveWsCaller imports move to ../ha/wsCaller where the helper actually lives (fetch.ts only re-exported it).
Flat per-action toolbar buttons do not scale once several integrations register — one "Integrations" dropdown now lists every toolbar-located plugin action grouped by plugin id. The location contract stays: 'toolbar' renders here, 'marker-menu'/'room-menu' remain reserved for contextual menus.
The example source now reads the device + entity registries — every HA instance has devices, so the reference implementation always has something to show, even where mqtt/zwave/etc. aren't configured. Devices are grouped by integration (entity platform), which doubles as the foundation for a "coverage map" showing which integrations have registered providers.
The device import moves from a modal wizard into the editor's "things to place" palette, as a tab next to Entities and Layers: - Devices tab: source picker + refresh (auto-fetches on open), a checklist with inline placement badges (room name / staged / on plan), select-by-group buttons, a collapsed Options details, and one "Place N markers" commit. Paste / file / project merge stays in the modal, reachable via "More…". - "Import card" leaves the toolbar for the Projects modal as "New from HA card…" — it produces a project, so it belongs with project lifecycle next to New / Import JSON. - New store field leftTab tracks the active palette section. The Devices toolbar button remains as a shortcut that selects the Devices tab.
Preview now behaves like an exported card: tap, hold (500ms) and double (cancels the pending tap) fire the marker's actions — toggle, more-info (hass-more-info event), call-service with YAML-parsed serviceData, navigate (location-changed), url. Service calls resolve to the hass object in card mode or HaClient standalone; with no HA link they log instead of silently dropping.
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #8 (stacked on #7 — merge PR 7 first).
Entities | Devices | Layers):↻refresh with auto-fetch on open.roomname /staged/on plan), group filter buttons, collapsed Options, and one undoablePlace N markersstep.DeviceImportModalviaMore….New from HA card…alongside+ New projectandImport JSON….src/canvas/actions.ts):tap(260 ms delay, cancelled by double-tap),hold(500 ms press), anddoubleexecutetoggle,more-info(hass-more-infoevent),call-service(with YAML-parsedserviceData),navigate(location-changed), andurl.Test plan
tsc --noEmit,vitest run(33 tests),npm run build,npm run build:hacscall-service