<html><head></head><body><div hidden="" by-polymer-bundler=""><dom-module id="events-list"><template><style>ul{margin:0;padding:0;}li{list-style:none;line-height:2em;}a{color:var(--dark-primary-color);}</style><ul><template is="dom-repeat" items="[[events]]" as="event"><li><a href="#" on-click="eventSelected">{{event.event}}</a> <span>(</span><span>{{event.listener_count}}</span><span> listeners)</span></li></template></ul></template></dom-module><script>class EventsList extends(window.hassMixins.EventsMixin(Polymer.Element)){static get is(){return"events-list"}static get properties(){return{hass:{type:Object},events:{type:Array}}}connectedCallback(){super.connectedCallback(),this.hass.callApi("GET","events").then(function(e){this.events=e}.bind(this))}eventSelected(e){e.preventDefault(),this.fire("event-selected",{eventType:e.model.event.event})}}customElements.define(EventsList.is,EventsList);</script></div><dom-module id="ha-panel-dev-event"><template><style is="custom-style" include="ha-style iron-flex iron-positioning"></style><style>:host{-ms-user-select:initial;-webkit-user-select:initial;-moz-user-select:initial;}.content{@apply (--paper-font-body1);padding:16px;}.ha-form{margin-right:16px;}.header{@apply (--paper-font-title);}</style><app-header-layout has-scrolling-region=""><app-header slot="header" fixed=""><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Events</div></app-toolbar></app-header><div class$="[[computeFormClasses(narrow)]]"><div class="flex"><p>Fire an event on the event bus.</p><div class="ha-form"><paper-input label="Event Type" autofocus="" required="" value="{{eventType}}"></paper-input><paper-textarea label="Event Data (JSON, optional)" value="{{eventData}}"></paper-textarea><paper-button on-tap="fireEvent" raised="">Fire Event</paper-button></div></div><div><div class="header">Available Events</div><events-list on-event-selected="eventSelected" hass="[[hass]]"></events-list></div></div></app-header-layout></template></dom-module><script>class HaPanelDevEvent extends(window.hassMixins.EventsMixin(Polymer.Element)){static get is(){return"ha-panel-dev-event"}static get properties(){return{hass:{type:Object},narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},eventType:{type:String,value:""},eventData:{type:String,value:""}}}eventSelected(e){this.eventType=e.detail.eventType}fireEvent(){var e;try{e=this.eventData?JSON.parse(this.eventData):{}}catch(e){return void alert("Error parsing JSON: "+e)}this.hass.callApi("POST","events/"+this.eventType,e).then(function(){this.fire("hass-notification",{message:"Event "+this.eventType+" successful fired!"})}.bind(this))}computeFormClasses(e){return e?"content fit":"content fit layout horizontal"}}customElements.define(HaPanelDevEvent.is,HaPanelDevEvent);</script></body></html>