Skip to content

Commit 858a3d6

Browse files
committed
Fix device list addr filter
1 parent 1e7ce70 commit 858a3d6

File tree

6 files changed

+7
-151
lines changed

6 files changed

+7
-151
lines changed

app/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ if (existsSync(resolve(__dirname, './package.json'))) {
1313
({version} = require('../package.json'));
1414
}
1515

16+
// No default values here to not overwrite store-defaults
1617
commander
1718
.description(`AskSin Analyzer XS v${version}\nhttps://github.com/psi-4ward/AskSinAnalyzerXS`)
1819
.version(version, '-v, --version', 'output the current version')
1920
.option('-l, --list-ports', 'List available serial ports')
2021
.option('-p, --serial-port <serialPort>', 'SerialPort')
21-
.option('-b, --baud <baudRate>', 'BaudRate of SerialPort', '57600')
22+
.option('-b, --baud <baudRate>', 'BaudRate of SerialPort')
2223
.option('-u, --url <deviceListUrl>', 'Host or IP of the CCU or URL to fetch the device-list')
2324
.option('-c, --ccu <bool>', 'Fetch the device-list from a CCU',
24-
(arg: string) => !(arg === 'false' || arg === 'no' || arg === '0'), true)
25+
(arg: string) => !(arg === 'false' || arg === 'no' || arg === '0'))
2526
.option('-d, --data <string>', 'Directory to store persistent data')
2627
.parse(process.argv);
2728

ui/src/Service.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,21 +175,21 @@ export default class Service {
175175
if (fromName && !this.devicesSet.has(fromName)) {
176176
this.devicesSet.add(fromName);
177177
newDeviceAdded = true;
178-
} else if (!this.devicesSet.has(fromAddr)) {
178+
} else if (!fromName && !this.devicesSet.has(fromAddr)) {
179179
this.devicesSet.add(fromAddr);
180180
newDeviceAdded = true;
181181
}
182182
if (toName && !this.devicesSet.has(toName)) {
183183
this.devicesSet.add(toName);
184184
newDeviceAdded = true;
185-
} else if (!this.devicesSet.has(toAddr)) {
185+
} else if (!toName && !this.devicesSet.has(toAddr)) {
186186
this.devicesSet.add(toAddr);
187187
newDeviceAdded = true;
188188
}
189189
});
190190
if(newDeviceAdded) {
191191
const devices = Array.from(this.devicesSet);
192-
devices.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
192+
devices.sort((a, b) => a.toString().toLowerCase().localeCompare(b.toString().toLowerCase()));
193193
this.data.devices.splice(0, devices.length, ...devices);
194194
}
195195
}

ui/src/components/TelegramList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
if (this.filter.fromName.length) {
170170
result = result.filter(v => {
171171
return this.filter.fromName.includes(v.fromName)
172-
|| this.filter.fromAddr.includes(v.fromName)
172+
|| this.filter.fromName.includes(v.fromAddr)
173173
|| this.filter.fromName.includes('==Unbekannt==') && v.fromName === '';
174174
});
175175
}

ui/tmp/DeviceCard.vue

Lines changed: 0 additions & 46 deletions
This file was deleted.

ui/tmp/NOTES.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

ui/tmp/TimeChart2.vue

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)