Skip to content

Commit

Permalink
Single File Components and Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mathertel committed Jan 30, 2025
1 parent 7e030db commit e917c0f
Show file tree
Hide file tree
Showing 64 changed files with 7,445 additions and 71 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions case/portal/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"webproxy": {
"00": { "element": "imkelight:scene/flow" },
"01": { "element": "imkelight:scene/red" },
"02": { "element": "imkelight:scene/green" },
"03": { "element": "imkelight:scene/ok" },

"1a": { "element": "rfbridge2:scene/dinner" },
"1b": { "element": "rfbridge2:scene/tv" },
"1c": { "element": "rfbridge2:scene/bright" },
"1d": { "element": "rfbridge2:scene/off" },

"1e": { "element": "rfbridge2:button/dampf" },

"20": { "element": "plug06:switch/relay" },
"21": { "element": "switch1:switch/relay" },

"30": { "element": "plug02:switch/relay" },
"3a": { "element": "bulb04:switch/en" },
"3b": { "element": "bulb04:color/l" },

"50": { "element": "airding:pms/pm25" },
"51": { "element": "airding:bme680/bd" }
}
}
13 changes: 13 additions & 0 deletions case/portal/homeding.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=HomeDing Service
After=network.target

[Service]
WorkingDirectory=/home/pi/WebFiles
ExecStart=/usr/bin/node app.js
Restart=on-failure
User=pi
# Environment=PORT=8000

[Install]
WantedBy=multi-user.target
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions server/HomeDingServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface HomeDingServerOptions {

export class HomeDingServer {

CASE_FOLDER = './case/';

// ===== private
private _app: Application = express();
private _api: Router = express.Router();
Expand Down Expand Up @@ -142,10 +144,10 @@ export class HomeDingServer {
// #region ===== Setup mocking and proxy elements =====

if (options.case) {
Logger.info(`Starting test case:; ${options.case}...`);
Logger.info(`Starting test case <${options.case}>...`);

if (fs.existsSync(`./test/${options.case}/`)) {
this._caseFolder = `./test/${options.case}/`;
if (fs.existsSync(`${this.CASE_FOLDER}${options.case}/`)) {
this._caseFolder = `${this.CASE_FOLDER}${options.case}/`;
} else if (fs.existsSync(`./case-${options.case}/`)) {
this._caseFolder = `case-${options.case}/`;
} else {
Expand Down
4 changes: 3 additions & 1 deletion sfc/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class UComponent extends HTMLElement {
}

adoptedCallback() {
// this.info("adoptedCallback", evt);
// this.info("adoptedCallback");
}

attributeChangedCallback(name, oldValue, newValue) {
Expand All @@ -94,7 +94,9 @@ class UComponent extends HTMLElement {
} // class UComponent



window.loadComponent = (function() {
console.debug('LOADER', `loadComponent...`);

async function fetchSFC(tagName, folder = '') {
let def;
Expand Down
Loading

0 comments on commit e917c0f

Please sign in to comment.