UNPKG

lavva.webbluetooth

Version:

Library implementing WebBluetooth custom functionality if underlying platform does support it

39 lines 2.03 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; export class ExternalIntegrationsStore { GetSupportedExternalIntegrationsAsync(integration, lang) { return __awaiter(this, void 0, void 0, function* () { //updates.tr7.pl/supportedDevices/pl-PL.json const url = `https://updates.tr7.pl/supportedexternalintegrations/${integration}/${lang}.json`; let res = yield fetch(url, { method: 'GET' }); if (res.ok) return JSON.parse(yield res.text()); else throw new Error("Failed to download supported external integrations list!"); }); } } export class SupportedExternalIntegration { constructor() { /// <summary> /// The unique id of the integration, for example "googleHome", "amazonAlexa", etc. This id should be used to identify the integration in the system and should not be changed once the integration is added to the system. /// </summary> this.Id = ""; /// <summary> /// The name of the integration, for example "Google Home", "Amazon Alexa", etc. /// </summary> this.Name = ""; /// <summary> /// The description of the integration (in markdown format, should support images also) /// </summary> this.Description = ""; } } //# sourceMappingURL=SupportedExternalIntegrations.js.map