{"id":29200610,"url":"https://github.com/domiot-io/iot-elements-node","last_synced_at":"2025-07-14T16:39:26.129Z","repository":{"id":299306952,"uuid":"1002634169","full_name":"domiot-io/iot-elements-node","owner":"domiot-io","description":"Collections of HTML/DOM elements for IoT systems by domain (home, retail, hospitality, etc.).","archived":false,"fork":false,"pushed_at":"2025-06-24T20:32:39.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T21:01:33.407Z","etag":null,"topics":["dom","domiot","elements","home-automation","html","iot","iot-system","nodejs","smart-building","web-components"],"latest_commit_sha":null,"homepage":"https://domiot.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/domiot-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-15T21:59:12.000Z","updated_at":"2025-06-24T20:32:43.000Z","dependencies_parsed_at":"2025-06-16T10:01:49.886Z","dependency_job_id":null,"html_url":"https://github.com/domiot-io/iot-elements-node","commit_stats":null,"previous_names":["domiot-io/iot-elements-node"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/domiot-io/iot-elements-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domiot-io%2Fiot-elements-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domiot-io%2Fiot-elements-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domiot-io%2Fiot-elements-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domiot-io%2Fiot-elements-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/domiot-io","download_url":"https://codeload.github.com/domiot-io/iot-elements-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domiot-io%2Fiot-elements-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263126317,"owners_count":23417777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dom","domiot","elements","home-automation","html","iot","iot-system","nodejs","smart-building","web-components"],"created_at":"2025-07-02T11:01:39.798Z","updated_at":"2025-07-02T11:02:27.255Z","avatar_url":"https://github.com/domiot-io.png","language":"JavaScript","readme":"# HTML/DOM IoT Element Factories\n\nCollections of HTML/DOM element factories for IoT systems by domain (home, retail, hospitality, etc.).\n\nElements refer to a single node in the HTML document structure, typically representing part of the logical structure (e.g. `\u003ciot-room\u003e\u003c/iot-room\u003e`, `\u003ciot-door/\u003e`, `\u003ciot-wardrobe\u003e\u003c/iot-wardrobe\u003e`).\n\nElement classes are required to implement their specific behaviors. For example, \"a door element should fire a `change` event when its state changes from `locked=true` to `locked=false` and vice versa\".\n\nElements are organized by domain because their meaning may change depending on the domain of application.\n\n## Installation\n\n```\nnpm install iot-elements-node\n```\n\n## Usage\n\n### Import domain-specific collections\n\n```\nimport { retailElementFactoryCollection } from 'iot-elements-node';\nimport { homeElementFactoryCollection } from 'iot-elements-node';\nimport { hospitalityElementFactoryCollection } from 'iot-elements-node';\n```\n\nThen you can use them in your IoT system HTML:\n```\n\u003chtml\u003e\n    \u003ciot-section\u003e\n        \u003ciot-aisle id=\"aisle6\" name=\"Coffee, Hot Beverages, Cookies \u0026 Chocolate\"\u003e\n\n            \u003ciot-ibits-button-binding id=\"a6ButtonBinding\" location=\"/dev/ihubx24-sim0\"\u003e\n            \u003ciot-obits-color-binding id=\"a6RelayBinding\" channels-per-element=\"2\" location=\"/dev/ohubx24-sim0\"\u003e\n\n            \u003ciot-button id=\"a6Product1Button\" shelving-unit-id=\"a6L1\" binding=\"a6ButtonBinding\"\u003e\n            \u003ciot-button id=\"a6Product2Button\" shelving-unit-id=\"a6L2\" binding=\"a6ButtonBinding\"\u003e\n\n            \u003ciot-shelving-unit id=\"a6L1\" name=\"Ground Coffee\" style=\"background-color:white;\" binding=\"a6RelayBinding:0\"\u003e\n            \u003ciot-shelving-unit id=\"a6L2\" name=\"Coffee Pods \u0026 K-Cups\" \n\n            \u003ciot-my-element\u003e\u003c/iot-my-element\u003e\n\n        \u003c/iot-aisle\u003e\n    \u003c/iot-section\u003e\n\u003c/html\u003e\n```\n\nPass the collections to the DOMIoT (you can pass none, one or more element factory collections to the DOMIoT.):\n\n```\nconst domiot = new DOMIoT(html, [retailElementFactoryCollection, myElementFactoryCollection]);\nconst document = domiot.window.document;\n\nconst button = document.getElementById('a6Product2Button');\n\nbutton.addEventListener('press', (ev) =\u003e {\n    const shelvingUnitId = ev.target.getAttribute('shelving-unit-id');\n    if (!shelvingUnitId) return;\n\n    const shelvingUnit = document.getElementById(shelvingUnitId);\n    if (!shelvingUnit) return;\n\n    // change the color of the shelving unit to blue,\n    // this changes the light color.\n    shelvingUnit.style.setProperty('color','blue');\n\n});\n\n...\n\n```\n\n### Import individual element creators\n\nUseful for creating your own collections (see below).\n\n```\nimport { createHTMLIoTButtonElement, createHTMLIoTAisleElement } from 'iot-elements-node/retail';\nimport { createHTMLIoTLampElement, createHTMLIoTRoomElement } from 'iot-elements-node/home';\nimport { createHTMLIoTDoorElement, createHTMLIoTCurtainElement } from 'iot-elements-node/hospitality';\n```\n\n## Create your collections using `HTMLElementFactoryCollection`\n\nYou can create your own collection of element factories using `HTMLElementFactoryCollection`\n\nExample:\n\n```\n'use strict';\nimport { HTMLElementFactoryCollection } from 'iot-elements-node';\n\nimport {\n    createHTMLIoTAisleElement,\n    createHTMLIoTShelvingUnitElement,\n    createHTMLIoTButtonElement,\n    createHTMLIoTVideoElement,\n    createHTMLIoTAudioElement\n} from 'iot-elements-node/retail';\n\nconst myElementFactoryCollection = new HTMLElementFactoryCollection();\n\nmyElementFactoryCollection.add('iot-aisle', createHTMLIoTAisleElement);\nmyElementFactoryCollection.add('iot-shelving-unit', createHTMLIoTShelvingUnitElement);\nmyElementFactoryCollection.add('iot-button', createHTMLIoTButtonElement);\nmyElementFactoryCollection.add('iot-video', createHTMLIoTVideoElement);\nmyElementFactoryCollection.add('iot-audio', createHTMLIoTAudioElement);\n```\n\n- `add(tagName, elementFactory)` - Add an element factory\n- `remove(tagName)` - Remove an element factory\n- `get(tagName)` - Get an element factory\n- Iterable (supports `for...of` loops):\n```\nfor (const [tagName, elementFactory] of collection) {\n    ...\n}\n```\n\n## Domain-specific collections\n\n### Retail\n`HTMLIoTAisleElement`\n\n`HTMLIoTAudioElement`\n\n`HTMLIoTBasketElement`\n\n`HTMLIoTButtonElement`\n\n`HTMLIoTColumnElement`\n\n`HTMLIoTCompartmentElement`\n\n`HTMLIoTCubbyElement`\n\n`HTMLIoTCustomerElement`\n\n`HTMLIoTDisplayUnitElement`\n\n`HTMLIoTEndcapElement`\n\n`HTMLIoTGondolaElement`\n\n`HTMLIoTItemElement`\n\n`HTMLIoTLineElement`\n\n`HTMLIoTPodiumElement`\n\n`HTMLIoTRoomElement`\n\n`HTMLIoTShelfElement`\n\n`HTMLIoTShelvingUnitElement`\n\n`HTMLIoTTileElement`\n\n`HTMLIoTVideoElement`\n\n### Home\n`HTMLIoTAudioElement`\n\n`HTMLIoTCurtainElement`\n\n`HTMLIoTLampElement`\n\n`HTMLIoTRoomElement`\n\n`HTMLIoTVideoElement`\n\n`HTMLIoTWindowElement`\n\n### Hospitality\n`HTMLIoTAudioElement`\n\n`HTMLIoTCurtainElement`\n\n`HTMLIoTDoorElement`\n\n`HTMLIoTLampElement`\n\n`HTMLIoTRoomElement`\n\n`HTMLIoTVideoElement`\n\n`HTMLIoTWindowElement`\n\n## License\n\nMIT.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomiot-io%2Fiot-elements-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomiot-io%2Fiot-elements-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomiot-io%2Fiot-elements-node/lists"}