import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { CurrentDeviceService, TapInfo, TapConfigItem } from '@iotize/ionic';
import { ToastService } from 'app-theme';
import { HostProtocol } from '@iotize/device-client.js';

@Component({
  selector: '<%= dasherize(name) %>',
  templateUrl: './<%= dasherize(name) %>.component.html',
  styleUrls: ['./<%= dasherize(name) %>.component.scss'],
})
export class <%= classify(name) %>Component implements OnInit {
  
  protocolSections: { title: string, icon?: string, items: TapConfigItem[] }[] = [];

  <%= renderEngine.renderTS('declaration', content) %>

  public get tap(){
    return this.tapService.tap;
  }

  constructor(
    private tapService: CurrentDeviceService
    , private toastService: ToastService) {

  }

  async ngOnInit() {
    <%= renderEngine.renderTS('init', content) %>
  }

  private onError(err: Error) {
    this.toastService.error(err);
  }


}
