better chromecast name
This commit is contained in:
parent
d10531c01b
commit
1354db6724
1 changed files with 3 additions and 1 deletions
|
@ -43,7 +43,9 @@ export default class ChromecastPlugin {
|
||||||
|
|
||||||
browser.on('update', (service: any) => {
|
browser.on('update', (service: any) => {
|
||||||
if (service.addresses && service.fullname && service.fullname.includes('_googlecast._tcp')) {
|
if (service.addresses && service.fullname && service.fullname.includes('_googlecast._tcp')) {
|
||||||
this.ondeviceup(service.addresses[0], service.fullname.substring(0, service.fullname.indexOf("._googlecast")) + " " + (service.type[0].description ?? ""), '', 'googlecast');
|
let a = service.txt.filter((u: any) => String(u).startsWith('fn='))
|
||||||
|
let name = (((a[0] ?? "").substring(3)) != "") ? ((a[0] ?? "").substring(3)) : (service.fullname.substring(0, service.fullname.indexOf("._googlecast")) )
|
||||||
|
this.ondeviceup(service.addresses[0], name+ " (" + (service.type[0]?.description ?? "") + ")" , '', 'googlecast');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const Client = require('node-ssdp').Client;
|
const Client = require('node-ssdp').Client;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue