diff --git a/sass/custom/_paulus.scss b/sass/custom/_paulus.scss index e74106df9c3..6720925343b 100644 --- a/sass/custom/_paulus.scss +++ b/sass/custom/_paulus.scss @@ -213,6 +213,11 @@ article.post, article.page, article.listing { text-decoration: none; } } + + h1, h2, h3 { + margin-bottom: 0; + line-height: 1.2; + } } p.note { diff --git a/source/_components/binary_sensor.markdown b/source/_components/binary_sensor.markdown index 48c8dd29afd..d15152753e2 100644 --- a/source/_components/binary_sensor.markdown +++ b/source/_components/binary_sensor.markdown @@ -18,12 +18,12 @@ Most binary sensors support the `SENSOR_CLASSES` which let you specify the type - **None**: Generic on/off - **opening**: Door, window, etc - **motion**: Motion sensor -- **gas'**: CO, CO2, etc -- **smoke'**: Smoke detector +- **gas**: CO, CO2, etc +- **smoke**: Smoke detector - **moisture**: Specifically a wetness sensor - **light**: Lightness threshold - **power**: Power, over-current, etc -- **safety**: Generic on=unsafe, off=safe +- **safety**: On means unsafe, Off means safe - **heat**: On means hot (or too hot) - **cold**: On means cold (or too cold) - **moving**: On means moving, Off means stopped diff --git a/source/_components/binary_sensor.template.markdown b/source/_components/binary_sensor.template.markdown index 5cadc4bad20..abe1160fd45 100644 --- a/source/_components/binary_sensor.template.markdown +++ b/source/_components/binary_sensor.template.markdown @@ -17,11 +17,11 @@ To enable Template binary sensors in your installation, add the following to you ```yaml # Example configuration.yaml entry binary_sensor: - platform: template - sensors: - sun_up: - value_template: {% raw %}'{{ states.sun.sun.attributes.elevation > 0}}'{% endraw %} - friendly_name: 'Sun is up' + - platform: template + sensors: + sun_up: + value_template: {% raw %}'{{ states.sun.sun.attributes.elevation > 0}}'{% endraw %} + friendly_name: 'Sun is up' ``` Configuration variables: @@ -30,8 +30,7 @@ Configuration variables: - **friendly_name** (*Optional*): Name to use in the Frontend. - **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. - - **warnings** (*Optional*): Turn off warnings (useful if the sensor is loaded before devices it depends on). - - **entity_id** (*Optional*): Add a list of entity_ids so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state. + - **entity_id** (*Optional*): Add a list of entity IDs so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state. ## {% linkable_title Examples %} @@ -43,26 +42,26 @@ This example indicates true if a sensor is above a given threshold. Assuming a s ```yaml sensor: - platform: template - sensors: - furnace_on: - value_template: {% raw %}{{ states.sensor.furnace.state > 2.5 }}{% endraw %} - friendly_name: 'Furnace Running - sensor_class: heat + - platform: template + sensors: + furnace_on: + value_template: {% raw %}{{ states.sensor.furnace.state > 2.5 }}{% endraw %} + friendly_name: 'Furnace Running + sensor_class: heat ``` ### {% linkable_title Switch as sensor %} -Some movement sensors and door/window sensors will apear as a switch. By using a template binary sensor, the switch can be displayed as a binary sensors. The original switch can then be hidden by [customizing.](/getting-started/customizing-devices/) +Some movement sensors and door/window sensors will appear as a switch. By using a template binary sensor, the switch can be displayed as a binary sensors. The original switch can then be hidden by [customizing.](/getting-started/customizing-devices/) ```yaml binary_sensor: - platform: template - sensors: - movement: - value_template: {% raw %}"{{ states.switch.movement.state == 'on' }}"{% endraw %} - sensor_class: motion - door: - value_template: {% raw %}"{{ states.switch.door.state == 'on' }}"{% endraw %} - sensor_class: opening + - platform: template + sensors: + movement: + value_template: {% raw %}"{{ states.switch.movement.state == 'on' }}"{% endraw %} + sensor_class: motion + door: + value_template: {% raw %}"{{ states.switch.door.state == 'on' }}"{% endraw %} + sensor_class: opening ``` diff --git a/source/_components/device_tracker.bluetooth_tracker.markdown b/source/_components/device_tracker.bluetooth_tracker.markdown index 0a98675fbe9..7fb68509c21 100644 --- a/source/_components/device_tracker.bluetooth_tracker.markdown +++ b/source/_components/device_tracker.bluetooth_tracker.markdown @@ -1,7 +1,7 @@ --- layout: page title: "Bluetooth Tracker" -description: "Instructions how to integrate bluetooth tracking within Home Assistant." +description: "Instructions for integrating bluetooth tracking within Home Assistant." date: 2016-04-10 17:24 sidebar: true comments: false @@ -13,11 +13,11 @@ ha_iot_class: "Local Poll" ha_release: 0.18 --- -This tracker discovers new devices on boot and tracks bluetooth devices periodically based on interval_seconds value. It is not requiered to pair the devices with eachother! -Devices discovered are stored with 'bt_' as the prefix for device mac address in `known_devices.yaml`. +This tracker discovers new devices on boot and tracks bluetooth devices periodically based on interval_seconds value. It is not required to pair the devices with each other! +Devices discovered are stored with 'bt_' as the prefix for device mac addresses in `known_devices.yaml`.

-Requires PyBluez. If you are on raspbian, make sure you first install `bluetooth` and `libbluetooth-dev` by running `sudo apt install bluetooth libbluetooth-dev` +Requires PyBluez. If you are on Raspbian, make sure you first install `bluetooth` and `libbluetooth-dev` by running `sudo apt install bluetooth libbluetooth-dev`

To use the Bluetooth tracker in your installation, add the following to your `configuration.yaml` file: diff --git a/source/_components/homematic.markdown b/source/_components/homematic.markdown index 446599b16cc..5adb4a24160 100644 --- a/source/_components/homematic.markdown +++ b/source/_components/homematic.markdown @@ -10,7 +10,7 @@ footer: true logo: homematic.png ha_category: Hub ha_iot_class: "Local Push" -featured: true +featured: false --- diff --git a/source/_components/http.markdown b/source/_components/http.markdown index 3d984ed8861..3341d121ace 100644 --- a/source/_components/http.markdown +++ b/source/_components/http.markdown @@ -25,8 +25,8 @@ http: ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem cors_allowed_origins: - - google.com - - home-assistant.io + - https://google.com + - https://home-assistant.io ``` Configuration variables: @@ -37,7 +37,7 @@ Configuration variables: - **development** (*Optional*): Disable caching and load unvulcanized assets. Useful for Frontend development. - **ssl_certificate** (*Optional*): Path to your TLS/SSL certificate to serve Home Assistant over a secure connection. - **ssl_key** (*Optional*): Path to your TLS/SSL key to serve Home Assistant over a secure connection. -- **cors_allowed_origins** (*Optional*): A list of origin domain names to allow [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) requests from. Enabling this will set the `Access-Control-Allow-Origin` header to the Origin header if it is found in the list, and the `Access-Control-Allow-Headers` to `Origin, Accept, X-Requested-With, Content-type, X-HA-access`. +- **cors_allowed_origins** (*Optional*): A list of origin domain names to allow [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) requests from. Enabling this will set the `Access-Control-Allow-Origin` header to the Origin header if it is found in the list, and the `Access-Control-Allow-Headers` header to `Origin, Accept, X-Requested-With, Content-type, X-HA-access`. You must provide the exact Origin, i.e. `https://home-assistant.io` will allow requests from `https://home-assistant.io` but __not__ `http://home-assistant.io`. The [Set up encryption using Let's Encrypt](/blog/2015/12/13/setup-encryption-using-lets-encrypt/) blog post gives you details about the encryption of your traffic using free certificates from [Let's Encrypt](https://letsencrypt.org/). diff --git a/source/_components/light.flux_led.markdown b/source/_components/light.flux_led.markdown index 84b3c4283e8..32ab0808cff 100644 --- a/source/_components/light.flux_led.markdown +++ b/source/_components/light.flux_led.markdown @@ -9,7 +9,7 @@ sharing: true footer: true ha_category: Light ha_iot_class: "Local Polling" -featured: true +featured: false ha_release: 0.25 --- diff --git a/source/_components/light.markdown b/source/_components/light.markdown index b2a244da8d2..028e89175d1 100644 --- a/source/_components/light.markdown +++ b/source/_components/light.markdown @@ -36,7 +36,7 @@ Turns one light on or multiple lights on using [groups]({{site_root}}/components | `transition` | yes | Integer that represents the time the light should take to transition to the new state in seconds. *not supported by Wink | `profile` | yes | String with the name of one of the built-in profiles (relax, energize, concentrate, reading) or one of the custom profiles defined in `light_profiles.csv` in the current working directory. Light profiles define a xy color and a brightness. If a profile is given and a brightness or xy color then the profile values will be overwritten. | `xy_color` | yes | A list containing two floats representing the xy color you want the light to be. Two comma seperated floats that represent the color in XY. -| `rgb_color` | yes | A list containing three integers representing the xy color you want the light to be. Three comma seperated integers that represent the color in RGB +| `rgb_color` | yes | A list containing three integers representing the rgb color you want the light to be. Three comma seperated integers that represent the color in RGB | `color_temp` | yes | An INT in mireds representing the color temperature you want the light to be. | `color_name` | yes | A human readable string of a color name, such as `blue` or `goldenrod` or [`chucknorris`](http://stackoverflow.com/questions/8318911/why-does-html-think-chucknorris-is-a-color). If your browser can display it, so can Home Assistant. | `brightness` | yes | Integer between 0 and 255 for how bright the color should be. diff --git a/source/_components/media_player.firetv.markdown b/source/_components/media_player.firetv.markdown index eead6cfc6dc..bb1a9ae3d59 100644 --- a/source/_components/media_player.firetv.markdown +++ b/source/_components/media_player.firetv.markdown @@ -27,7 +27,7 @@ Steps to configure your Amazon Fire TV stick with Home Assistant: - From the main (Launcher) screen, select Settings. - Select System > About > Network. - `pip install firetv[firetv-server]` into a Python 2.x environment - - If installed on Debian Jessie then the libssl-dev package is needed. Install it with `apt-get install libssl-dev` + - If installed on Debian Jessie then the libssl-dev and python-dev packages are needed. Install them with `apt-get install libssl-dev python-dev` - `firetv-server -d :5555`, background the process - Configure Home Assistant as follows: diff --git a/source/_components/media_player.mpchc.markdown b/source/_components/media_player.mpchc.markdown index 76c7e443954..0f16a25798b 100644 --- a/source/_components/media_player.mpchc.markdown +++ b/source/_components/media_player.mpchc.markdown @@ -9,7 +9,7 @@ sharing: true footer: true logo: mpchc.png ha_category: Media Player -featured: true +featured: false ha_release: 0.25.0 --- diff --git a/source/_components/media_player.plex.markdown b/source/_components/media_player.plex.markdown index 7f462f1191c..0ca2d456134 100644 --- a/source/_components/media_player.plex.markdown +++ b/source/_components/media_player.plex.markdown @@ -47,3 +47,12 @@ In case [discovery](/components/discovery/) does not work (GDM disabled or non-l - **TOKEN** (*Optional*): Only if authentication is required. Set to `null` (without quotes) otherwise. At this moment, the Plex platform only supports one Plex Media Server. + +It is possible to get errors that look like the following. + +``` +ERROR:plexapi:http://192.168.1.10:32400: ('Connection aborted.', BadStatusLine("''",)) +INFO:homeassistant.components.media_player.plex:No server found at: http://192.168.1.10:32400 +``` + +If this occurs, try changing the setting `Secure connections` in your Plex Media Server to `Preferred` (instead of `Required`). The Plex component does not currently support HTTPS. diff --git a/source/_components/notify.telegram.markdown b/source/_components/notify.telegram.markdown index cc7dfe0a657..07455bd989d 100644 --- a/source/_components/notify.telegram.markdown +++ b/source/_components/notify.telegram.markdown @@ -20,16 +20,7 @@ The requirements are: - You need a [Telegram bot](https://core.telegram.org/bots). Please follow those [instructions](https://core.telegram.org/bots#botfather) to create one and get the token for your bot. Keep in mind that bots are not allowed to contact users. You need to make the first contact with your user. Meaning that you need to send a message to the bot from your user. - The `chat_id` of an user. -An easy way to get your chat ID is described below: - -```python -import telegram -bot = telegram.Bot(token='YOUR_API_TOKEN') -chat_id = bot.getUpdates()[-1].message.chat_id -print(chat_id) -``` - -Another way to retrieve your `chat_id` is visiting [https://api.telegram.org/botYOUR_API_TOKEN/getUpdates](https://api.telegram.org/botYOUR_API_TOKEN/getUpdates). +The quickest way to retrieve your `chat_id` is visiting [https://api.telegram.org/botYOUR_API_TOKEN/getUpdates](https://api.telegram.org/botYOUR_API_TOKEN/getUpdates). The result set will include your chat ID as `id` in the `from` section: @@ -47,6 +38,16 @@ The result set will include your chat ID as `id` in the `from` section: ... ``` +Another way to get your chat ID directly is described below: + +```python +import telegram +bot = telegram.Bot(token='YOUR_API_TOKEN') +chat_id = bot.getUpdates()[-1].message.chat_id +print(chat_id) +123456789 +``` + To enable Telegram notifications in your installation, add the following to your `configuration.yaml` file: ```yaml diff --git a/source/_components/octoprint.markdown b/source/_components/octoprint.markdown index c86b1975aeb..9642fb40701 100644 --- a/source/_components/octoprint.markdown +++ b/source/_components/octoprint.markdown @@ -28,3 +28,5 @@ Configuration variables: - **api_key** (*Required*): The retrieved api key. - **host** (*Required*): The octoprint host. + +**NOTE** If your 3D printer isn't connected to the OctoPrint server during the startup of Home Assistant this component will fail to load. diff --git a/source/_components/panel_iframe.markdown b/source/_components/panel_iframe.markdown index b10cfa9690e..1f856987205 100644 --- a/source/_components/panel_iframe.markdown +++ b/source/_components/panel_iframe.markdown @@ -15,6 +15,8 @@ ha_release: 0.25 The `panel_iframe` support allows you to add additional panels to your Home Assistant frontend. The panels are listed in the sidebar and can contain external resources like the web frontend of your router, your monitoring system, or your media server. +

If you are accessing home Assistant over HTTPS using SSL, you cannot access HTTP sites through an iframe panel.

+ To enable Panel iFrames in your installation, add the following to your `configuration.yaml` file: ```yaml diff --git a/source/_components/sensor.envisalink.markdown b/source/_components/sensor.envisalink.markdown index 5f42edda39f..24f6474f145 100644 --- a/source/_components/sensor.envisalink.markdown +++ b/source/_components/sensor.envisalink.markdown @@ -1,7 +1,7 @@ --- layout: page -title: "Vera Sensor" -description: "Instructions how to integrate Vera sensors into Home Assistant." +title: "Envisalink Sensor" +description: "Instructions how to integrate Envisalink sensors into Home Assistant." date: 2016-07-01 10:00 sidebar: true comments: false diff --git a/source/_components/sensor.mqtt.markdown b/source/_components/sensor.mqtt.markdown index b64ed6d1c48..d1704a7bf07 100644 --- a/source/_components/sensor.mqtt.markdown +++ b/source/_components/sensor.mqtt.markdown @@ -61,3 +61,33 @@ sensor: value_template: {% raw %}'{{ value_json.batt }}'{% endraw %} ``` +### {% linkable_title Get temperature and humidity %} + +If you are using a DHT sensor and a NodeMCU board (esp8266), you can retrieve temperature and humidity with a MQTT sensor. A code example can be found [here](https://github.com/mertenats/open-home-automation/tree/master/ha_mqtt_sensor_dht22). A regular MQTT message from this example looks like this: + +``` +office/sensor1 + { + "temperature": 23.20, + "humidity": 43.70 + } +``` + +Then use this configuration example to extract the data from the payload: + +```yaml +# Example configuration.yml entry +sensor 1: + platform: mqtt + state_topic: 'office/sensor1' + name: 'Temperature' + unit_of_measurement: '°C' + value_template: '{{ value_json.temperature }}' + +sensor 2: + platform: mqtt + state_topic: 'office/sensor1' + name: 'Humidity' + unit_of_measurement: '%' + value_template: '{{ value_json.humidity }}' +``` diff --git a/source/_components/sensor.nzbget.markdown b/source/_components/sensor.nzbget.markdown index 89179741e25..90204ace3d4 100644 --- a/source/_components/sensor.nzbget.markdown +++ b/source/_components/sensor.nzbget.markdown @@ -8,6 +8,7 @@ comments: false sharing: true footer: true ha_category: Sensor +logo: nzbget.png ha_iot_class: "Local Polling" ha_release: 0.17 --- diff --git a/source/_components/sensor.openexchangerates.markdown b/source/_components/sensor.openexchangerates.markdown index 8041e159d56..e237b289b63 100644 --- a/source/_components/sensor.openexchangerates.markdown +++ b/source/_components/sensor.openexchangerates.markdown @@ -23,15 +23,16 @@ To enable this sensor, add the following lines to your `configuration.yaml` file ```yaml # Example configuration.yaml entry sensor: - platform: openexchangerates - api_key: your_api_key - base: USD #optional - quote: EUR - name: USDEUR #optional + - platform: openexchangerates + api_key: YOUR_API_KEY + base: USD + quote: EUR + name: USDEUR ``` Configuration variables: +- **api_key** (*Required*): API Key for [Open Exchange Rates](https://openexchangerates.org). - **name** (*Optional*): Name to use in the frontend. - **base** (*Optional*): The symbol of the base currency. Defaults to USD - **quote** (*Required*): The symbol of the quote or target currency. diff --git a/source/_components/sensor.openweathermap.markdown b/source/_components/sensor.openweathermap.markdown index 01673022dc4..0207c3cc732 100644 --- a/source/_components/sensor.openweathermap.markdown +++ b/source/_components/sensor.openweathermap.markdown @@ -50,7 +50,7 @@ Configuration variables: - **rain**: The rain volume. - **snow**: The snow volume -Details about the API are available in the [OpenWeatherMap documentation](http://bugs.openweathermap.org/projects/api/wiki). +Details about the API are available in the [OpenWeatherMap documentation](http://openweathermap.org/api). Only metric measurements are supported at the moment. diff --git a/source/_components/sensor.systemmonitor.markdown b/source/_components/sensor.systemmonitor.markdown index bfab57abd1d..c3aec6419d8 100644 --- a/source/_components/sensor.systemmonitor.markdown +++ b/source/_components/sensor.systemmonitor.markdown @@ -9,6 +9,7 @@ sharing: true footer: true ha_category: Sensor ha_release: pre 0.7 +ha_iot_class: "Local Push" --- The `systemmonitor` sensor platform to allow you to monitor disk usage, memory usage, CPU usage, and running processes. This platform has superseded the process component which is now considered deprecated. @@ -18,12 +19,12 @@ To add this platform to your installation, add the following to your `configurat ```yaml # Example configuration.yaml entry sensor: - platform: systemmonitor - resources: - - type: disk_use_percent - arg: /home - - type: memory_free - - type: processor_use + - platform: systemmonitor + resources: + - type: disk_use_percent + arg: /home + - type: memory_free + - type: processor_use ``` Configuration variables: @@ -34,7 +35,7 @@ Configuration variables: The table contains types and their argument to use in your `configuration.yaml` file. -| Type (`- type:`) | Argument (`arg:`) | +| Type (`type:`) | Argument (`arg:`) | | :------------------ |:-------------------------| | disk_use_percent | Path, eg. `/` | | disk_use | Path, eg. `/` | diff --git a/source/_components/sensor.template.markdown b/source/_components/sensor.template.markdown index 70f56d15e56..59ff3813524 100644 --- a/source/_components/sensor.template.markdown +++ b/source/_components/sensor.template.markdown @@ -18,14 +18,14 @@ To enable Template sensors in your installation, add the following to your `conf ```yaml # Example configuration.yaml entry sensor: - platform: template - sensors: - solar_angle: - value_template: {% raw %}'{{ states.sun.sun.attributes.elevation }}'{% endraw %} - friendly_name: 'Sun angle' - unit_of_measurement: 'degrees' - sunrise: - value_template: {% raw %}'{{ states.sun.sun.attributes.next_rising }}'{% endraw %} + - platform: template + sensors: + solar_angle: + value_template: {% raw %}'{{ states.sun.sun.attributes.elevation }}'{% endraw %} + friendly_name: 'Sun angle' + unit_of_measurement: 'degrees' + sunrise: + value_template: {% raw %}'{{ states.sun.sun.attributes.next_rising }}'{% endraw %} ``` Configuration variables: @@ -34,8 +34,7 @@ Configuration variables: - **friendly_name** (*Optional*): Name to use in the Frontend. - **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. - - **warnings** (*Optional*): Turn off warnings (useful if the sensor is loaded before devices it depends on). - - **entity_id** (*Optional*): Add a list of entity_ids so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state. + - **entity_id** (*Optional*): Add a list of entity IDs so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state. ## {% linkable_title Examples %} @@ -48,12 +47,12 @@ This example shows the sun angle in the frontend. ```yaml sensor: - platform: template - sensors: - solar_angle: - value_template: {% raw %}'{{ "%+.1f"|format(states.sun.sun.attributes.elevation) }}'{% endraw %} - friendly_name: 'Sun Angle' - unit_of_measurement: '°' + - platform: template + sensors: + solar_angle: + value_template: {% raw %}'{{ "%+.1f"|format(states.sun.sun.attributes.elevation) }}'{% endraw %} + friendly_name: 'Sun Angle' + unit_of_measurement: '°' ``` ### {% linkable_title Renaming sensor output %} @@ -62,22 +61,22 @@ If you don't like the wording of a sensor output then the template sensor can he ```yaml sensor: - platform: template - sensors: - sun_state: - value_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}up{% else %}down{% endif %}'{% endraw %} - friendly_name: 'Sun state' + - platform: template + sensors: + sun_state: + value_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}up{% else %}down{% endif %}'{% endraw %} + friendly_name: 'Sun state' ``` Processes monitored by the [System Monitor sensor](/components/sensor.systemmonitor/) show `on` or `off` if they are running or not. This example shows how the output of a monitored `glances` process can be renamed. ```yaml sensor: - platform: template - sensors: - glances: - value_template: {% raw %}'{% if is_state("sensor.process_glances", "off") %}not running{% else %}running{% endif %}'{% endraw %} - friendly_name: 'Glances' + - platform: template + sensors: + glances: + value_template: {% raw %}'{% if is_state("sensor.process_glances", "off") %}not running{% else %}running{% endif %}'{% endraw %} + friendly_name: 'Glances' ``` By comparing the details published on the [template](/topics/templating/) page the same can be archived with a different approach: @@ -88,31 +87,34 @@ value_template: {% raw %}"{%if states.sensor.ENTITY_ID.state == 'on' %}running{% The [Binary template sensor](/components/binary_sensor.template/) is the one in similar cases if you prefer to see an icon instead of text. -### {% linkable_title Multiline example with an if test (and warnings disabled) %} +### {% linkable_title Multiline example with an if test %} -This example shows a multiple line template with and if test. It looks at a sensing switch and shows on/off in the frontend. It disables warnings to avoid log messages where the switch it depends on isn't loaded yet. +This example shows a multiple line template with and if test. It looks at a sensing switch and shows on/off in the frontend. ```yaml sensor: - platform: template - sensors: - kettle: - friendly_name: 'Kettle' - {% raw %}value_template: >- - {%- if is_state("switch.kettle", "off") %} - off - {% elif states.switch.kettle.attributes.kwh < 1000 %} - standby - {% elif is_state("switch.kettle", "on") %} - on - {% else %} - failed - {%- endif %}{% endraw %} + - platform: template + sensors: + kettle: + friendly_name: 'Kettle' + {% raw %}value_template: >- + {%- if is_state("switch.kettle", "off") %} + off + {% elif states.switch.kettle.attributes.kwh < 1000 %} + standby + {% elif is_state("switch.kettle", "on") %} + on + {% else %} + failed + {%- endif %}{% endraw %} - warnings: Off + next_sensor: + [...] ``` -(please note the blank line to close the multi-line template) +

+Please note the blank line to close the multi-line template. +

### {% linkable_title Change the unit of measurment %} @@ -120,15 +122,15 @@ With a template sensor it's easy to convert given values into others if the unit ```yaml sensor: - platform: template - sensors: - transmission_down_speed_kbps: - value_template: {% raw %}'{{ states.sensor.transmission_down_speed.state | multiply(1024) }}'{% endraw %} - friendly_name: 'Transmission Down Speed' - unit_of_measurement: 'kB/s' - transmission_up_speed_kbps: - value_template: {% raw %}'{{ states.sensor.transmission_up_speed.state | multiply(1024) }}'{% endraw %} - friendly_name: 'Transmission Up Speed' - unit_of_measurement: 'kB/s' + - platform: template + sensors: + transmission_down_speed_kbps: + value_template: {% raw %}'{{ states.sensor.transmission_down_speed.state | multiply(1024) }}'{% endraw %} + friendly_name: 'Transmission Down Speed' + unit_of_measurement: 'kB/s' + transmission_up_speed_kbps: + value_template: {% raw %}'{{ states.sensor.transmission_up_speed.state | multiply(1024) }}'{% endraw %} + friendly_name: 'Transmission Up Speed' + unit_of_measurement: 'kB/s' ``` diff --git a/source/_components/sensor.zigbee.markdown b/source/_components/sensor.zigbee.markdown index 45a58641aca..58d436ccd27 100644 --- a/source/_components/sensor.zigbee.markdown +++ b/source/_components/sensor.zigbee.markdown @@ -11,30 +11,45 @@ logo: zigbee.png ha_category: Sensor --- -There are two types of ZigBee sensor available to Home Assistant: +There are two types of [ZigBee](http://www.zigbee.org/) sensor available to Home Assistant: - [Analog input pin](#analog-input-pin) - [Temperature sensor](#temperature-sensor) (XBee Pro) -## {% linkable_title Analog Input Pin %} - -The analog input pins on an XBee (non-Pro) will read 0V to 1.2V. This is translated by the [xbee-helper](https://github.com/flyte/xbee-helper) library into a percentage. The maximum voltage your ZigBee device will read is configurable using the `max_volts` configuration variable. - -To configure an analog input pin sensor, use the following variables: - -- **name** (*Required*): The name you'd like to give the sensor in Home Assistant. -- **platform** (*Required*): Set to `zigbee`. -- **type** (*Required*): Set to `analog`. -- **pin** (*Required*): The number identifying which pin to sample. -- **address**: The long 64bit address of the remote ZigBee device whose analog input pin you'd like to sample. Do not include this variable if you want to sample the local ZigBee device's pins. -- **max_volts**: The maximum voltage which the analog input pin is able to read. Default: `1.2` - -#### Example +To configure an analog input pin sensor, add the following to your `configuration.yaml` file: ```yaml +# Example configuration.yaml entry sensor: - - name: My Analog Input - platform: zigbee + - platform: zigbee + name: My Analog ZigBee Input + type: analog + pin: 0 + address: 0013A2004233D138 +``` + +Configuration variables: + +- **name** (*Required*): The name you would like to give the sensor in Home Assistant. +- **type** (*Required*): Set to `analog` or `temperature`. +- **pin** (*Required*): The number identifying which pin to sample +- **address** (*Optional*): The long 64 bit address of the remote ZigBee device whose pin you would like to sample. Do not include this variable if you want to sample the local ZigBee device's pins. +- **max_volts** (*Optional*): The maximum voltage which the input pin is able to read. Defaults to `1.2` + + +## {% linkable_title Examples %} + +### {% linkable_title Analog Input Pin %} + +The analog input pins on an XBee (non-Pro) will read 0V to 1.2 V. This is translated by the [xbee-helper](https://github.com/flyte/xbee-helper) library into a percentage. The maximum voltage your ZigBee device will read is configurable using the `max_volts` configuration variable. + +To configure an analog input pin sensor, add the following to your `configuration.yaml` file: + +```yaml +## Example configuration.yaml entry +sensor: + - platform: zigbee + name: My Analog ZigBee Input type: analog pin: 0 address: 0013A2004233D138 @@ -44,19 +59,16 @@ See the [Digi knowledge base](http://knowledge.digi.com/articles/Knowledge_Base_ ## {% linkable_title Temperature Sensor %} -The XBee Pro (and perhaps other third party modules) contains a thermometer device which can be read by using the `TP` AT command. To set this up as a temperature sensor device in Home Assistant use the following config variables: +The XBee Pro (and perhaps other third party modules) contains a thermometer device which can be read by using the `TP` AT command. -- **name** (*Required*): The name you'd like to give the temperature sensor in Home Assistant -- **platform** (*Required*): Set to `zigbee` -- **type** (*Required*): Set to `temperature` -- **address**: The long 64bit address of the remote ZigBee device whose temperature sensor you'd like to sample. Do not include this variable if you want to sample the local ZigBee device's temperature. - -#### Example +To configure a temperature sensor device, add the following to your `configuration.yaml` file: ```yaml +# Example configuration.yaml entry sensor: - - name: Living Room Temperature - platform: zigbee + - platform: zigbee + name: Living Room Temperature ZigBee type: temperature address: 0013A20050E752C5 -``` \ No newline at end of file +``` + diff --git a/source/_components/switch.flux.markdown b/source/_components/switch.flux.markdown index b78679e6693..18604e9df07 100644 --- a/source/_components/switch.flux.markdown +++ b/source/_components/switch.flux.markdown @@ -19,7 +19,7 @@ During the day (in between `start time` and `sunset time`), it will fade the lig If you don't wish to have flux update on 30 second intervals, you can leave the switch turned off and use automation rules that call the service `switch.flux_update` whenever you want the lights updated. -To use your TPLink switch in your installation, add the following to your `configuration.yaml` file: +To use the Flux switch in your installation, add the following to your `configuration.yaml` file: ```yaml # Example configuration.yaml entry diff --git a/source/_components/switch.template.markdown b/source/_components/switch.template.markdown index 7ddf487bf16..256c34fa5a3 100644 --- a/source/_components/switch.template.markdown +++ b/source/_components/switch.template.markdown @@ -22,17 +22,17 @@ To enable Template switches in your installation, add the following to your `con ```yaml # Example configuration.yaml entry switch: - platform: template + - platform: template switches: - skylight: - friendly_name: 'Skylight' - value_template: {% raw %}'{{ states.sensor.skylight.state }}'{% endraw %} - turn_on: - service: switch.turn_on - entity_id: switch.skylight_open - turn_off: - service: switch.turn_on - entity_id: switch.skylight_close + skylight: + friendly_name: 'Skylight' + value_template: {% raw %}'{{ is_state('sensor.skylight', 'on') }}'{% endraw %} + turn_on: + service: switch.turn_on + entity_id: switch.skylight_open + turn_off: + service: switch.turn_on + entity_id: switch.skylight_close ``` Configuration variables: @@ -42,7 +42,13 @@ Configuration variables: - **value_template** (*Required*): Defines a [template](/topics/templating/) to set the state of the switch. - **turn_on** (*Required*): Defines an [action](/getting-started/automation/) to run when the switch is turned on. - **turn_off** (*Required*): Defines an [action](/getting-started/automation/) to run when the switch is turned off. - - **entity_id** (*Optional*): Add a list of entity_ids so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state. + - **entity_id** (*Optional*): Add a list of entity IDs so the switch only reacts to state changes of these entities. This will reduce the number of times the switch will try to update it's state. + + +## {% linkable_title Considerations %} + +If you are using the state of a platform that takes extra time to load, the template switch may get an 'unknown' state during startup. This results in error messages in your log file until that platform has completed loading. If you use is_state() function in your template, you can avoid this situation. For example, you would replace {% raw %}'{{ states.switch.source.state }}'{% endraw %} with this equivalent that returns true/false and never gives an unknown result: +{% raw %}'{{ is_state('switch.source', 'on') }}'{% endraw %} ## {% linkable_title Examples %} @@ -54,16 +60,16 @@ This example shows a switch that copies another switch. ```yaml switch: - platform: template + - platform: template switches: - copy: - value_template: {% raw %}'{{ states.switch.source.state }}'{% endraw %} - turn_on: - service: switch.turn_on - entity_id: switch.source - turn_off: - service: switch.turn_off - entity_id: switch.source + copy: + value_template: {% raw %}'{{ is_state('switch.source', 'on') }}'{% endraw %} + turn_on: + service: switch.turn_on + entity_id: switch.source + turn_off: + service: switch.turn_off + entity_id: switch.source ```` ### {% linkable_title Toggle switch %} @@ -72,17 +78,17 @@ This example shows a switch that takes its state from a sensor, and toggles a sw ```yaml switch: - platform: template + - platform: template switches: - blind: - friendly_name: 'Blind' - value_template: {% raw %}'{{ state }}'{% endraw %} - turn_on: - service: switch.toggle - entity_id: switch.blind_toggle - turn_off: - service: switch.toggle - entity_id: switch.blind_toggle + blind: + friendly_name: 'Blind' + value_template: {% raw %}'{{ state }}'{% endraw %} + turn_on: + service: switch.toggle + entity_id: switch.blind_toggle + turn_off: + service: switch.toggle + entity_id: switch.blind_toggle ``` ### {% linkable_title Sensor and two switches %} @@ -91,15 +97,16 @@ This example shows a switch that takes its state from a sensor, and uses two mom ```yaml switch: - platform: template + - platform: template switches: - skylight: - friendly_name: 'Skylight' - value_template: {% raw %}'{{ states.sensor.skylight.state }}'{% endraw %} - turn_on: - service: switch.turn_on - entity_id: switch.skylight_open - turn_off: - service: switch.turn_on - entity_id: switch.skylight_close + skylight: + friendly_name: 'Skylight' + value_template: {% raw %}'{{ is_state('sensor.skylight.state', 'on') }}'{% endraw %} + turn_on: + service: switch.turn_on + entity_id: switch.skylight_open + turn_off: + service: switch.turn_on + entity_id: switch.skylight_close ``` + diff --git a/source/_cookbook/custom_panel_using_react.markdown b/source/_cookbook/custom_panel_using_react.markdown index bf77af0d4fd..a3d8911e88e 100644 --- a/source/_cookbook/custom_panel_using_react.markdown +++ b/source/_cookbook/custom_panel_using_react.markdown @@ -18,19 +18,18 @@ This is a [React](https://facebook.github.io/react/) implementation of [TodoMVC] - It uses the user configuration for the component in the `configuration.yaml` file for rendering. - It allows toggling the sidebar. -All you need is available as a [custom component](https://github.com/home-assistant/home-assistant/tree/master/config/panels). +All you need is available as a [custom panel](https://github.com/home-assistant/home-assistant/tree/master/config/panels/react.html). Download the file and save it in `/panels/` (you might have to create the directory if it doesn't exist). Create a entry for the panel in your `configuration.yaml` file to enable it. ```yaml panel_custom: - - name: todomvc + - name: react sidebar_title: TodoMVC sidebar_icon: mdi:work - url_path: my-todomvc - webcomponent_path: /panels/.html + url_path: todomvc config: - hello: world + title: hello ``` This video shows the example in action. diff --git a/source/_includes/asides/about.html b/source/_includes/asides/about.html index c8129671e7f..e71429e1191 100644 --- a/source/_includes/asides/about.html +++ b/source/_includes/asides/about.html @@ -7,6 +7,7 @@
  • Get started with Home Assistant
  • Try the online demo
  • +
  • diff --git a/source/_posts/2016-07-30-custom-frontend-panels--jupyter-notebooks--directv.markdown b/source/_posts/2016-07-30-custom-frontend-panels--jupyter-notebooks--directv.markdown index 795a8ec9145..46c2678eb16 100644 --- a/source/_posts/2016-07-30-custom-frontend-panels--jupyter-notebooks--directv.markdown +++ b/source/_posts/2016-07-30-custom-frontend-panels--jupyter-notebooks--directv.markdown @@ -57,6 +57,17 @@ I would like to do a shoutout to [@fabianhjr]. He has started adding [typing] da - Qwikswitch: Stability fixes ([@kellerza]) - Light: [Hyperion] keeps now track of active color ([@schneefux]) +### {% linkable_title Hotfix 0.25.1 - August 1 %} + +- Light - Z-Wave: Bring back delayed value update behavior ([@jnewland]) +- Recorder: Properly close session after execute ([@kellerza]) +- Media Player - Kodi: No longer block startup if connecting to wrong port ([@shoekstra]) +- Downgrade voluptuous to 0.8.9 as it blocked the upgrade for some ([@balloob]) + +### {% linkable_title Hotfix 0.25.2 - August 2 %} + +- Hotfix to make sure Z-Wave locks work again. Thanks to @tobiebooth for the quick fix. + ### {% linkable_title Breaking changes %} - Google Voice SMS notification support was removed. @@ -89,6 +100,8 @@ I would like to do a shoutout to [@fabianhjr]. He has started adding [typing] da [@vladonemo]: https://github.com/vladonemo [@w1ll1am23]: https://github.com/w1ll1am23 [@zeroDenial]: https://github.com/zeroDenial +[@jnewland]: https://github.com/jnewland +[@shoekstra]: https://github.com/shoekstra [custom-panels]: /developers/frontend_creating_custom_panels/ [iframe_panel]: /components/panel_iframe/ diff --git a/source/_posts/2016-08-03-laundry-automation-update.markdown b/source/_posts/2016-08-03-laundry-automation-update.markdown new file mode 100644 index 00000000000..983f7062792 --- /dev/null +++ b/source/_posts/2016-08-03-laundry-automation-update.markdown @@ -0,0 +1,115 @@ +--- +layout: post +title: "Laundry Sensors with NodeMCU and Home Assistant" +description: "Nolan describes how he gets notified when laundry is done." +date: 2016-08-03 10:22 -0700 +date_formatted: "August 2, 2016" +author: Nolan Gilley +comments: true +categories: User-Stories +og_image: /images/blog/2016-07-laundry-automation/protoboard.jpg +--- + +_This is a guest post by Home Assistant user and contributor [Nolan Gilley](https://github.com/nkgilley)._ + +Today I'll show you how I used Home Assistant, a NodeMCU (ESP8266), and a couple of accelerometers to automate our laundry room. This is a rewrite of an [old post](https://home-assistant.io/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/) where I did the same thing using a Moteino & Raspberry Pi. This version only requires a NodeMCU. + +We have an older washer and dryer which doesn't have any form of notification when cycles complete. Home Assistant was the obvious solution, I just needed to create sensors for the washer and dryer. I tried using sound sensors but found them unreliable. I ended up using an accelerometer attached to the back of each appliance. I also added magnetic reed switches on the doors of the washer and dryer to detect whether they're open or closed. I connected the accelerometers and reed switches to an NodeMCU which will relay the data to my MQTT broker. + +

    + + Block diagram of schematic +

    + + + +After taking some sample data from the accelerometers while each appliance was in operation, I decided to plot the data to help determine the proper thresholds of when the devices were running or off. I had to do this in order to get precise ranges so the dryer sensor wouldn't get tripped by the washer or vice versa. In the plot below you can see the acceleration in each direction for the accelerometer connected to the dryer. It's easy to see when the dryer is in operation here. I used the same technique for the washer's accelerometer. + +

    + + Graph showing the accelerometer data +

    + +Next it was just a matter of integrating everything with Home Assistant. I was able to use the [MQTT component](/components/mqtt/) to read the washer and dryer states from the Moteino and display it in Home Assistant. + +

    + + Status of the dryer and washer in Home Assistant +

    + +Next I wrote [scripts](/components/script/) that are run whenever the washer or dryer completes a load. This is triggered by the [automation component](/getting-started/automation/). When the laundry is complete I have the lights in the house turn red and [notify me via Join](/components/notify.joaoapps_join/). Once the door is opened and laundry emptied another script runs that sets the lights back to normal. So far it has been very helpful and very reliable. + +

    + + + + NodeMCU connected to MPU-6050 accelerometer. +

    + +Materials used: + + - [NodeMCU](https://www.amazon.com/gp/product/B010O1G1ES) + - [2 x Accelerometers](http://www.amazon.com/gp/product/B008BOPN40) + - [2 x Reed switch](http://www.amazon.com/gp/product/B004PARDRO) + +[Sketch for the NodeMCU is available here.](https://github.com/nkgilley/nodemcu-laundry/blob/master/nodemcu-laundry.ino) + +Home Assistant Configuration: + +```yaml +mqtt: + broker: 192.168.1.100 + port: 1883 + keepalive: 60 + qos: 0 + +sensor: + - platform: mqtt + name: "Dryer Status" + state_topic: "sensor/dryer" + unit_of_measurement: "" + + - platform: mqtt + name: "Washer Status" + state_topic: "sensor/washer" + unit_of_measurement: "" + +automation: + - alias: Washer complete + trigger: + platform: state + entity_id: sensor.washer_status + from: 'Running' + to: 'Complete' + action: + service: script.turn_on + entity_id: script.washer_complete + + - alias: Washer emptied + trigger: + platform: state + entity_id: sensor.washer_status + from: 'Complete' + to: 'Empty' + action: + service: scene.turn_on + entity_id: scene.normal + +script: + washer_complete: + alias: Washer Complete + sequence: + - alias: Join Notification + service: notify.join + data: + message: "The washing machine has finished its cycle, please empty it!" + - alias: Living Room Lights Blue + service: scene.turn_on + data: + entity_id: scene.blue +``` + +Resources used: + + - [Inspiration and Help with Arduino code](http://www.instructables.com/id/Uber-Home-Automation-w-Arduino-Pi/step13/Washer-Dryer-Smartifier-Water-Leak-Sensor/) + diff --git a/source/_posts/2016-08-07-optimizing-the-home-assistant-mobile-web-app.markdown b/source/_posts/2016-08-07-optimizing-the-home-assistant-mobile-web-app.markdown new file mode 100644 index 00000000000..e9a892b4925 --- /dev/null +++ b/source/_posts/2016-08-07-optimizing-the-home-assistant-mobile-web-app.markdown @@ -0,0 +1,180 @@ +--- +layout: post +title: "Optimizing the Home Assistant mobile web app" +description: "A comprehensive list of optimizations done to improve our mobile web application." +date: 2016-08-07 12:36 -0700 +date_formatted: "August 7, 2016" +author: Paulus Schoutsen +comments: true +categories: Technology +og_image: /images/blog/2016-08-optimizing-web-app/performance-diagram.png +--- + +_This blog post will go into detail about the recent performance optimizations that went into the Home Assistant front end. For people not familiar with the app, check out [the demo][demo] and [the source][hap]._ + +TL; DR: Don’t hack the framework, separate responsibilities, ship less, use service workers, use (future) web standards. + +This year at Google I/O I saw Monica from the Polymer team talk about web components and performance. In her talk [she mentions a mantra][mantra] that they use in the Polymer team to make things fast: **Do less and be lazy**. + +Do less and be lazy. It sounds so obvious and it took a while before it started to dawn on me. I think most of the code I write is pretty fast, but I don't often stop to take a harder look at how and when it runs in practice. When do we need the result, can it be postponed? + +And thus started my journey to take a critical look at how the Home Assistant app was working and how to make things faster. Below is the list of the different things that I did to make it fast. + +I hope this list can be useful to other people, as a guide for optimizing their own apps or for avoiding pitfalls when building a new one. + +The first thing to do is to measure. The Home Assistant front end is a mobile web app, so we shouldn’t measure this on a machine with 8 cores and gigabytes of ram but instead measure on devices you expect a mobile web app to run: phones. Below are two timelines recorded with Home Assistant 0.18.2 (pre-optimizations) and Google Chrome 53. **On my Mac the app starts in 1400 miliseconds and on my Nexus 5x in ~6500 miliseconds (~4.5 times slower!).** + +

    + Timeline of loading the front end in Home Assistant 0.18.2 +

    + +Although the app takes 6500 milliseconds to load on my phone, it would perform well afterwards. Still, that initial load is unacceptable. You expect to open an app on your phone and be able to use it, quickly. After I applied all the changes described below, I managed to reduce startup time to 900 miliseconds (-35%) on my Mac and 2400 miliseconds (-63%) on my Nexus 5x. [Check out the demo here.][demo] + +

    + diagram showing old and new loading times next to one another + Timeline of loading the front end in Home Assistant 0.26 +

    + + + +## {% linkable_title Technology %} + +The Home Assistant front end consists of two parts. There is [Home Assistant JS][hajs], which controls all data and interaction between JavaScript and the server. It is a Flux architecture using [NuclearJS] and [ImmutableJS]. The UI is implemented by [Home Assistant Polymer][hap] using [Polymer] and web components. + +# {% linkable_title Don’t hack the framework %} + +I thought to be smart. I split out the JavaScript part of all web components and bundled them separately using Webpack so that I could use ES2015 via BabelJS ([architecture][es2015-arch]). This is not how Polymer components are written and it meant that I was unable to use any of the tooling that is available in the community or easily split up the bundle (more on this later). + +So I went ahead and backported all my web components back from shiny beautiful ES6 to ES5. And you know what? It’s not that bad. Yes, not being able to use the concise object notation and arrow functions make your code more verbose. But in the end it is the same code that is running in browsers. + +Another benefit of having each web component contain their own script tag is that the browser will process them one by one, allowing the browser to render our loading spinner animation in between. + +As you can see in the timelines, we were able to get rid of most of the blocking component loading. + +

    + Timeline of loading the front end before and after the optimization +

    + +# {% linkable_title Separate responsibilities %} + +Whenever you learn a new technology, you feel like you’ve learned a new superpower. Wow, I can do all this with only 2 lines?! I had the same with bundling. + +I was initially very focused on shipping just a single file with everything that my app needed. The entry point would be my main component which would require all of its Flux and UI dependencies. Then, just before it all would be rendered, it would check if there is authentication and start the data fetching. + +This is a very bad pattern. This means that you will not start any data fetching until your UI is ready to render. Instead, you want your data to be fetched as soon as possible, and while the request is out to the server you want the page to load all your UI components. + +To accomplish this I extracted the application core out of the main bundle. In the current optimized version it’s 31.1kb gzip’d. It is loaded before any other scripts so that it can start fetching data as soon as possible. + +

    + Timeline of loading the front end before and after the optimization +

    + +When the data does come back before the UI is done loading, we can process it before we start rendering the UI because of all the web components being processed individually. This means that we don't have to show a loading screen the first time our components render – we can just render the components with the data they require. + +# {% linkable_title Ship less %} + +The theory behind this one is simple: if we manage to ship less code, the browser has to process less code and it will start faster. + +## {% linkable_title Only include the components for the page that you will show %} + +The Home Assistant mobile web application has 10 different panels (pages). Besides that, it also has a dialog for each type of device to show more info. That’s a lot of components and screens of which only a very small set is needed at the start. That means that we are shipping a lot of unnecessary data that the browser has to process before our initial render! + +I broke up each panel of the app into a separate bundle that will be loaded on demand. This saved 250 kilobytes (pre-gzip) on just the embedded map alone! This change, however, required some significant changes to our build process. + +Breaking up an app in JavaScript is complex because each module explicitly imports their dependencies. This has to continue to work in your browser after breaking it up in multiple files. Web components do not have this problem as it’s part of the platform and thus your browser is the registry! An unregistered web component will be rendered as an empty span element until the element gets registered. Loading order is not important. + +```javascript +// Example of the flexibility of web components. +var spinner = document.createElement('paper-spinner'); +spinner.active = true; +document.body.appendChild(spinner); +``` + +Because the browser tracks your web components, creating standalone bundles for parts of the app is easy: + + - Find all dependencies included in the main bundle (using [hydrolysis]) + - Create individual bundles of each panel (page) but filter out the dependencies included in main bundle. + +The [build script][build-html] that bundles and minifies the main bundle and panel bundles is <100 lines. + +## {% linkable_title Change the JavaScript bundler to Rollup %} + +Core.js is still pure JavaScript and requires bundling. In my journey to get a smaller bundle, I went from [Webpack] to Webpack 2 to [Rollup]. At each step the bundle got smaller. Rollup is the big winner here because it doesn’t wrap all your modules in function calls but instead concatenates all files with minimal changes to make it work. This not only reduces the file size but also the loading speed. This is because the JavaScript engine will no longer have to invoke a function to resolve each import, it’s doing less work. This might not mean much for a computer but on a phone, everything counts. + +## {% linkable_title Scrutinize dependencies %} + +If the goal is to ship less, it’s time to take a good look at dependencies. It’s so often that we decide to fall back to yet another NPM package that makes our life a little easier but comes at the cost of size – size usually taken up by functionality that you might never need. + +### {% linkable_title Remove Lodash %} +I realized that I only used a few methods of lodash. Lodash (and previously underscore) used to be one of the dependencies that would always be one of the first things that I would add to any project I start. But I could no longer justify it in the case of Home Assistant. Even with dead tree shaking it was not worth including it. Yes, they support a lot of edge cases but those were not relevant to my use case. And standalone lodash packages are [still huge][lodash.range]. The only thing that I couldn’t replace with a few lines of my own code was debounce. However I found [a 40 line replacement][debounce]. + +### {% linkable_title Replace moment.js with Fecha %} + +Moment.js is one of those power libraries. It is able to handle any date problem that you can throw at it. But this obviously comes at the cost of size. [Fecha] is a date formatting library at ~8% the size of moment.js (only 4.7kb pre-gzip). The only thing that it does not contain is date manipulation, which was something that was not being used. + +# {% linkable_title Use Service worker to instantly load the app %} + +Using a service worker we’re able to store all app components and core javascript in the browser. This means that after their first visit, the browser will only have to go to the network to fetch the latest data from the server. + +Creating a service worker is easy using [sw-precache], a service worker generation tool. + +When a browser does not support service workers, Home Assistant will serve fingerprinted assets that are aggressively cached. Only when the content changes will the client redownload the asset. + +Using fingerprinting with sw-precache required jumping through a few hoops. [The final build script can be found here.][build-sw] + +# {% linkable_title Make it feel fast %} + +This one is more psychological: no one likes staring at a white screen because white screens are ambiguous: are we loading something, is there a crappy connection or maybe even a script error? That’s why it is very important to render something on the screen to show that the rest is being loaded, and as quickly as possible. + +The Home Assistant landing page contains just enough CSS and HTML to render the loading screen minus the animations. + +Now that the app is fast enough, I might swap out moving from a lite loading screen to drawing an empty toolbar. This makes it look like the UI is almost there. + +# {% linkable_title Using a framework build on web standards %} + +_I left this to the end of the list, mainly because I had no influence on this. Polymer just happened to ship an update while I was optimizing the application which gave a big boost to the loading time._ + +By using Polymer we have the ability to use tomorrow’s web standards today. This is powered by polyfills. A polyfill will use JavaScript to simulate the behavior that the web standard would have taken care of. As browsers progress, more work can move from the polyfills back to the browsers. This is great because browsers will be able to optimize the work better and thus be faster. + +Polymer 1.6 was introduced at the end of June and allowed the app to take advantage of native [CSS variables][css-vars] in Chrome and Firefox. It also introduced lazy registration. Both greatly sped up our loading times. + +# {% linkable_title Future optimizations %} + +A lot of optimizations have been applied but this journey will never be over. There are still a lot of opportunities to make things even faster. Some ideas that are on my list to explore: + +- Use shadow DOM instead of shady DOM polyfill. +- Use [closure compiler][closure] to optimize the JavaScript. +- Reduce the number of icons that are loaded. +- Embed initial API response in served page if not using a service worker. +- Reduce size of initial bundle by moving out all things that are not visible for initial paint. For example the dialogs that show more info about entities. +- Prefetch the other pages using `` + +[demo]: https://home-assistant.io/demo +[hap]: https://github.com/home-assistant/home-assistant-polymer +[mantra]: https://www.youtube.com/watch?v=zfQoleQEa4w&feature=youtu.be&t=1380 +[sw-precache]: https://github.com/GoogleChrome/sw-precache +[hydrolysis]: https://github.com/Polymer/hydrolysis +[hajs]: https://github.com/home-assistant/home-assistant-js +[es2015-arch]: https://github.com/home-assistant/home-assistant-polymer/wiki/Using-Polymer-with-ES2015,-Babel-and-NPM +[NuclearJS]: https://optimizely.github.io/nuclear-js/ +[ImmutableJS]: https://facebook.github.io/immutable-js/ +[Polymer]: https://www.polymer-project.org/ +[build-html]: https://github.com/home-assistant/home-assistant-polymer/blob/master/script/vulcanize.js +[Webpack]: https://webpack.github.io/ +[Rollup]: http://rollupjs.org/ +[lodash.range]: https://github.com/lodash/lodash/blob/3.1.7-npm-packages/lodash.range/index.js +[debounce]: https://github.com/component/debounce +[Fecha]: https://github.com/taylorhakes/fecha +[build-sw]: https://github.com/home-assistant/home-assistant-polymer/blob/master/script/sw-precache.js +[css-vars]: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables +[closure]: https://developers.google.com/closure/compiler/ \ No newline at end of file diff --git a/source/_topics/secrets.markdown b/source/_topics/secrets.markdown index 5b5096ea1bb..c6db498dfce 100644 --- a/source/_topics/secrets.markdown +++ b/source/_topics/secrets.markdown @@ -13,9 +13,9 @@ The `configuration.yaml` file a plain-text file thus it is readable for everyone ### {% linkable_title Using secrets.yaml %} -The workflow for the outsourcing in the `secrets.yaml` are very similar to the [splitting of the configuration](/topics/splitting_configuration/). Create a `secrets.yaml` file in your Home assistant configuration directory (The location of the folder differs between operating systems: on OS X and Linux it's `~/.homeassistant` and on Windows it's `%APPDATA%/.homeassistant`). +The workflow for the outsourcing in the `secrets.yaml` is very similar to the [splitting of the configuration](/topics/splitting_configuration/). Create a `secrets.yaml` file in your Home assistant configuration directory (The location of the folder differs between operating systems: on OS X and Linux it's `~/.homeassistant` and on Windows it's `%APPDATA%/.homeassistant`). -The entries for password and API keys in the `configuration.yaml` file usally looks like the example below. +The entries for password and API keys in the `configuration.yaml` file usually looks like the example below. ```yaml http: @@ -29,7 +29,7 @@ http: api_password: !secret http_password ``` -The `secrets.yaml` files stored the corresponding password assigned to the identifier. +The `secrets.yaml` file contains the corresponding password assigned to the identifier. ```yaml logger: debug @@ -44,7 +44,7 @@ Using [Keyring](http://pythonhosted.org/keyring/) is an alternative way to `secr $ pip3 install keyring ``` -Replaced your password or API key with `!secret` and an identifier in `configuration.yaml` file. +Replace your password or API key with `!secret` and an identifier in `configuration.yaml` file. ```yaml http: diff --git a/source/_topics/state_object.markdown b/source/_topics/state_object.markdown index 1f1a16425f3..35716de6b58 100644 --- a/source/_topics/state_object.markdown +++ b/source/_topics/state_object.markdown @@ -37,3 +37,5 @@ Attribute | Description `entity_picture` | Url to a picture that should be used instead of showing the domain icon. Example: `http://example.com/picture.jpg`. `assumed_state` | Boolean if the current state is an assumption. [More info](https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things/#classifiers) Example: `True`. `unit_of_measurement` | The unit of measurement the state is expressed in. Used for grouping graphs or understanding the entity. Example: `°C`. + +When an attribute contains spaces, you can retrieve it like this: `states.sensor.livingroom.attributes["Battery numeric"]`. diff --git a/source/demo/core.js b/source/demo/core.js index 51612006af3..70e13f1f149 100644 --- a/source/demo/core.js +++ b/source/demo/core.js @@ -1,4 +1,4 @@ -!function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}function e(t,e){var n=e.authToken,r=e.host;return Te({authToken:n,host:r,isValidating:!0,isInvalid:!1,errorMessage:""})}function n(){return Ae.getInitialState()}function r(t,e){var n=e.errorMessage;return t.withMutations(function(t){return t.set("isValidating",!1).set("isInvalid",!0).set("errorMessage",n)})}function i(t,e){var n=e.authToken,r=e.host;return Ce({authToken:n,host:r})}function o(){return ze.getInitialState()}function u(t,e){var n=e.rememberAuth;return n}function a(t){return t.withMutations(function(t){t.set("isStreaming",!0).set("useStreaming",!0).set("hasError",!1)})}function s(t){return t.withMutations(function(t){t.set("isStreaming",!1).set("useStreaming",!1).set("hasError",!1)})}function c(t){return t.withMutations(function(t){t.set("isStreaming",!1).set("hasError",!0)})}function f(){return Ue.getInitialState()}function h(t,e){var n=e.model,r=e.result,i=e.params,o=n.entity;if(!r)return t;var u=i.replace?t.set(o,Ke({})):t,a=Array.isArray(r)?r:[r],s=n.fromJSON||Ke;return u.withMutations(function(t){return a.forEach(function(e){var n=s(e);t.setIn([o,n.id],n)})})}function l(t,e){var n=e.model,r=e.params;return t.removeIn([n.entity,r.id])}function p(t){var e={};return e.incrementData=function(e,n,r){void 0===r&&(r={}),_(e,t,r,n)},e.replaceData=function(e,n,r){void 0===r&&(r={}),_(e,t,Je({},r,{replace:!0}),n)},e.removeData=function(e,n){S(e,t,{id:n})},t.fetch&&(e.fetch=function(e,n){return void 0===n&&(n={}),e.dispatch(Fe.API_FETCH_START,{model:t,params:n,method:"fetch"}),t.fetch(e,n).then(_.bind(null,e,t,n),d.bind(null,e,t,n))}),e.fetchAll=function(e,n){return void 0===n&&(n={}),e.dispatch(Fe.API_FETCH_START,{model:t,params:n,method:"fetchAll"}),t.fetchAll(e,n).then(_.bind(null,e,t,Je({},n,{replace:!0})),d.bind(null,e,t,n))},t.save&&(e.save=function(e,n){return void 0===n&&(n={}),e.dispatch(Fe.API_SAVE_START,{params:n}),t.save(e,n).then(v.bind(null,e,t,n),y.bind(null,e,t,n))}),t.delete&&(e.delete=function(e,n){return void 0===n&&(n={}),e.dispatch(Fe.API_DELETE_START,{params:n}),t.delete(e,n).then(S.bind(null,e,t,n),m.bind(null,e,t,n))}),e}function _(t,e,n,r){return t.dispatch(Fe.API_FETCH_SUCCESS,{model:e,params:n,result:r}),r}function d(t,e,n,r){return t.dispatch(Fe.API_FETCH_FAIL,{model:e,params:n,reason:r}),Promise.reject(r)}function v(t,e,n,r){return t.dispatch(Fe.API_SAVE_SUCCESS,{model:e,params:n,result:r}),r}function y(t,e,n,r){return t.dispatch(Fe.API_SAVE_FAIL,{model:e,params:n,reason:r}),Promise.reject(r)}function S(t,e,n,r){return t.dispatch(Fe.API_DELETE_SUCCESS,{model:e,params:n,result:r}),r}function m(t,e,n,r){return t.dispatch(Fe.API_DELETE_FAIL,{model:e,params:n,reason:r}),Promise.reject(r)}function g(t){t.registerStores({restApiCache:Ye})}function E(t){return[["restApiCache",t.entity],function(t){return!!t}]}function I(t){return[["restApiCache",t.entity],function(t){return t||We({})}]}function b(t){return function(e){return["restApiCache",t.entity,e]}}function w(t){return new Date(t)}function O(t,e,n,r){void 0===r&&(r=null);var i,o=t.evaluate(Xr.authInfo),u=(o.host+"/api/"+n,n.split("/",1)[0]);switch(u){case"bootstrap":i=window.hassDemoData.bootstrap;break;case"logbook":i=window.hassDemoData.logbook;break;case"history":i=window.hassDemoData.stateHistory;break;default:i=!1}return new Promise(function(t,e){i?t(i):e("Request not allowed in demo mode.")})}function T(t,e){var n=e.message;return t.set(t.size,n)}function A(){return gn.getInitialState()}function D(t,e){t.dispatch(yn.NOTIFICATION_CREATED,{message:e})}function C(t){t.registerStores({notifications:gn})}function z(t,e){if("lock"===t)return!0;if("garage_door"===t)return!0;var n=e.get(t);return!!n&&n.services.has("turn_on")}function R(t,e){return!!t&&("group"===t.domain?"on"===t.state||"off"===t.state:z(t.domain,e))}function M(t,e){return[Bn(t),function(t){return!!t&&t.services.has(e)}]}function L(t){return[dn.byId(t),Yn,R]}function j(t,e,n){function r(){var c=(new Date).getTime()-a;c0?i=setTimeout(r,e-c):(i=null,n||(s=t.apply(u,o),i||(u=o=null)))}var i,o,u,a,s;null==e&&(e=100);var c=function(){u=this,o=arguments,a=(new Date).getTime();var c=n&&!i;return i||(i=setTimeout(r,e)),c&&(s=t.apply(u,o),u=o=null),s};return c.clear=function(){i&&(clearTimeout(i),i=null)},c}function N(t,e){var n=e.component;return t.push(n)}function k(t,e){var n=e.components;return or(n)}function U(){return ur.getInitialState()}function P(t,e){var n=e.latitude,r=e.longitude,i=e.location_name,o=e.temperature_unit,u=e.time_zone,a=e.version;return sr({latitude:n,longitude:r,location_name:i,temperature_unit:o,time_zone:u,serverVersion:a})}function H(){return cr.getInitialState()}function x(t,e){t.dispatch(rr.SERVER_CONFIG_LOADED,e)}function V(t){en(t,"GET","config").then(function(e){return x(t,e)})}function q(t,e){t.dispatch(rr.COMPONENT_LOADED,{component:e})}function F(t){return[["serverComponent"],function(e){return e.contains(t)}]}function G(t){t.registerStores({serverComponent:ur,serverConfig:cr})}function K(t){return t.evaluate(er)}function Y(t){K(t)&&(t.hassId in mr||(mr[t.hassId]=j(J.bind(null,t),Sr)),mr[t.hassId]())}function B(t){var e=mr[t.hassId];e&&e.clear()}function J(t){return t.dispatch(Pe.API_FETCH_ALL_START,{}),en(t,"GET","bootstrap").then(function(e){t.batch(function(){_n.replaceData(t,e.states),Xn.replaceData(t,e.services),Un.replaceData(t,e.events),dr.configLoaded(t,e.config),t.dispatch(Pe.API_FETCH_ALL_SUCCESS,{})}),Y(t)},function(e){return t.dispatch(Pe.API_FETCH_ALL_FAIL,{message:e}),Y(t),Promise.reject(e)})}function W(t,e){void 0===e&&(e={});var n=e.skipInitialSync;void 0===n&&(n=!1),t.dispatch(Pe.SYNC_SCHEDULED),n?Y(t):J(t)}function X(t){t.dispatch(Pe.SYNC_SCHEDULE_CANCELLED),B(t)}function Q(t){t.registerStores({isFetchingData:xe,isSyncScheduled:qe})}function Z(t,e){switch(e.event_type){case"state_changed":e.data.new_state?_n.incrementData(t,e.data.new_state):_n.removeData(t,e.data.entity_id);break;case"component_loaded":dr.componentLoaded(t,e.data.component);break;case"service_registered":Xn.serviceRegistered(t,e.data.domain,e.data.service)}}function $(t){var e=Tr[t.hassId];e&&(e.scheduleHealthCheck.clear(),e.source.close(),Tr[t.hassId]=!1)}function tt(t,e){void 0===e&&(e={});var n=e.syncOnInitialConnect;void 0===n&&(n=!0),$(t);var r=j(tt.bind(null,t),Or),i=j(tt.bind(null,t),wr),o=t.evaluate(Xr.authToken),u=new EventSource("/api/stream?api_password="+o+"&restrict="+Ar),a=n;Tr[t.hassId]={source:u,scheduleHealthCheck:i},u.addEventListener("open",function(){i(),t.batch(function(){t.dispatch(Le.STREAM_START),Er.stop(t),a?Er.fetchAll(t):a=!0})},!1),u.addEventListener("message",function(e){i(),"ping"!==e.data&&Z(t,JSON.parse(e.data))},!1),u.addEventListener("error",function(){r(),u.readyState!==EventSource.CLOSED&&t.dispatch(Le.STREAM_ERROR)},!1)}function et(t){$(t),t.batch(function(){t.dispatch(Le.STREAM_STOP),Er.start(t)})}function nt(t){t.registerStores({streamStatus:Ue})}function rt(t,e,n){void 0===n&&(n={});var r=n.useStreaming;void 0===r&&(r=t.evaluate(Nr.isSupported));var i=n.rememberAuth;void 0===i&&(i=!1);var o=n.host;void 0===o&&(o=""),o="/demo",t.dispatch(we.VALIDATING_AUTH_TOKEN,{authToken:e,host:o}),Er.fetchAll(t).then(function(){return t.dispatch(we.VALID_AUTH_TOKEN,{authToken:e,host:o,rememberAuth:i}),void t.dispatch("STREAM_START")},function(e){void 0===e&&(e={});var n=e.message;void 0===n&&(n=Ur),t.dispatch(we.INVALID_AUTH_TOKEN,{errorMessage:n})})}function it(t){t.dispatch(we.LOG_OUT,{})}function ot(t){t.registerStores({authAttempt:Ae,authCurrent:ze,rememberAuth:Me})}function ut(t,e){var n=e.pane;return n}function at(){return ti.getInitialState()}function st(t,e){var n=e.show;return!!n}function ct(){return ni.getInitialState()}function ft(t,e){t.dispatch(Zr.SHOW_SIDEBAR,{show:e})}function ht(t,e){t.dispatch(Zr.NAVIGATE,{pane:e})}function lt(t){return[ii,function(e){return e===t}]}function pt(t,e){var n=e.entityId;return n}function _t(){return ci.getInitialState()}function dt(t,e){t.dispatch(ai.SELECT_ENTITY,{entityId:e})}function vt(t){t.dispatch(ai.SELECT_ENTITY,{entityId:null})}function yt(t){return!t||(new Date).getTime()-t>6e4}function St(t,e){return e?t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate():t.getUTCFullYear()+"-"+(t.getUTCMonth()+1)+"-"+t.getUTCDate()}function mt(t,e){var n=e.date;return St(n,!0)}function gt(){return pi.getInitialState()}function Et(t,e){var n=e.date,r=e.stateHistory;return 0===r.length?t.set(n,di({})):t.withMutations(function(t){r.forEach(function(e){return t.setIn([n,e[0].entity_id],di(e.map(an.fromJSON)))})})}function It(){return vi.getInitialState()}function bt(t,e){var n=e.stateHistory;return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,gi(e.map(an.fromJSON)))})})}function wt(){return Ei.getInitialState()}function Ot(t,e){var n=e.stateHistory,r=(new Date).getTime();return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,r)}),history.length>1&&t.set(wi,r)})}function Tt(){return Oi.getInitialState()}function At(t,e){t.dispatch(hi.ENTITY_HISTORY_DATE_SELECTED,{date:e})}function Dt(t,e){void 0===e&&(e=null),t.dispatch(hi.RECENT_ENTITY_HISTORY_FETCH_START,{});var n="history/period";return null!==e&&(n+="?filter_entity_id="+e),en(t,"GET",n).then(function(e){return t.dispatch(hi.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,{stateHistory:e})},function(){return t.dispatch(hi.RECENT_ENTITY_HISTORY_FETCH_ERROR,{})})}function Ct(t,e){return t.dispatch(hi.ENTITY_HISTORY_FETCH_START,{date:e}),en(t,"GET","history/period/"+e).then(function(n){return t.dispatch(hi.ENTITY_HISTORY_FETCH_SUCCESS,{date:e,stateHistory:n})},function(){return t.dispatch(hi.ENTITY_HISTORY_FETCH_ERROR,{})})}function zt(t){var e=t.evaluate(Di);return Ct(t,e)}function Rt(t){t.registerStores({currentEntityHistoryDate:pi,entityHistory:vi,isLoadingEntityHistory:Si,recentEntityHistory:Ei,recentEntityHistoryUpdated:Oi})}function Mt(t){t.registerStores({moreInfoEntityId:ci})}function Lt(t,e){var n=e.model,r=e.result,i=e.params;if(null===t||"entity"!==n.entity||!i.replace)return t;for(var o=0;oGo}function oe(t){t.registerStores({currentLogbookDate:zo,isLoadingLogbookEntries:Mo,logbookEntries:Po,logbookEntriesUpdated:Vo})}function ue(t,e){return en(t,"POST","template",{template:e})}function ae(t){return t.set("isListening",!0)}function se(t,e){var n=e.interimTranscript,r=e.finalTranscript;return t.withMutations(function(t){return t.set("isListening",!0).set("isTransmitting",!1).set("interimTranscript",n).set("finalTranscript",r)})}function ce(t,e){var n=e.finalTranscript;return t.withMutations(function(t){return t.set("isListening",!1).set("isTransmitting",!0).set("interimTranscript","").set("finalTranscript",n)})}function fe(){return au.getInitialState()}function he(){return au.getInitialState()}function le(){return au.getInitialState()}function pe(t){return su[t.hassId]}function _e(t){var e=pe(t);if(e){var n=e.finalTranscript||e.interimTranscript;t.dispatch(iu.VOICE_TRANSMITTING,{finalTranscript:n}),Xn.callService(t,"conversation","process",{text:n}).then(function(){t.dispatch(iu.VOICE_DONE)},function(){t.dispatch(iu.VOICE_ERROR)})}}function de(t){var e=pe(t);e&&(e.recognition.stop(),su[t.hassId]=!1)}function ve(t){_e(t),de(t)}function ye(t){var e=ve.bind(null,t);e();var n=new webkitSpeechRecognition;su[t.hassId]={recognition:n,interimTranscript:"",finalTranscript:""},n.interimResults=!0,n.onstart=function(){return t.dispatch(iu.VOICE_START)},n.onerror=function(){return t.dispatch(iu.VOICE_ERROR)},n.onend=e,n.onresult=function(e){var n=pe(t);if(n){for(var r="",i="",o=e.resultIndex;o=n)}function c(t,e){return h(t,e,0)}function f(t,e){return h(t,e,e)}function h(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function l(t){return v(t)?t:C(t)}function p(t){return y(t)?t:z(t)}function _(t){return S(t)?t:R(t)}function d(t){return v(t)&&!m(t)?t:M(t)}function v(t){return!(!t||!t[dn])}function y(t){return!(!t||!t[vn])}function S(t){return!(!t||!t[yn])}function m(t){return y(t)||S(t)}function g(t){return!(!t||!t[Sn])}function E(t){this.next=t}function I(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function b(){return{value:void 0,done:!0}}function w(t){return!!A(t)}function O(t){return t&&"function"==typeof t.next}function T(t){var e=A(t);return e&&e.call(t)}function A(t){var e=t&&(In&&t[In]||t[bn]);if("function"==typeof e)return e}function D(t){return t&&"number"==typeof t.length}function C(t){return null===t||void 0===t?P():v(t)?t.toSeq():V(t)}function z(t){return null===t||void 0===t?P().toKeyedSeq():v(t)?y(t)?t.toSeq():t.fromEntrySeq():H(t)}function R(t){return null===t||void 0===t?P():v(t)?y(t)?t.entrySeq():t.toIndexedSeq():x(t)}function M(t){return(null===t||void 0===t?P():v(t)?y(t)?t.entrySeq():t:x(t)).toSetSeq()}function L(t){this._array=t,this.size=t.length}function j(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function N(t){this._iterable=t,this.size=t.length||t.size}function k(t){this._iterator=t,this._iteratorCache=[]}function U(t){return!(!t||!t[On])}function P(){return Tn||(Tn=new L([]))}function H(t){var e=Array.isArray(t)?new L(t).fromEntrySeq():O(t)?new k(t).fromEntrySeq():w(t)?new N(t).fromEntrySeq():"object"==typeof t?new j(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function x(t){var e=q(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function V(t){var e=q(t)||"object"==typeof t&&new j(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function q(t){return D(t)?new L(t):O(t)?new k(t):w(t)?new N(t):void 0}function F(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;u<=o;u++){var a=i[n?o-u:u];if(e(a[1],r?a[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,n)}function G(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new E(function(){var t=i[n?o-u:u];return u++>o?b():I(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function K(){throw TypeError("Abstract")}function Y(){}function B(){}function J(){}function W(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function X(t,e){return e?Q(e,t,"",{"":t}):Z(t)}function Q(t,e,n,r){return Array.isArray(e)?t.call(r,n,R(e).map(function(n,r){return Q(t,n,r,e)})):$(e)?t.call(r,n,z(e).map(function(n,r){return Q(t,n,r,e)})):e}function Z(t){return Array.isArray(t)?R(t).map(Z).toList():$(t)?z(t).map(Z).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return tt(n)}return"string"===e?t.length>jn?nt(t):rt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function nt(t){var e=Un[t];return void 0===e&&(e=rt(t),kn===Nn&&(kn=0,Un={}),kn++,Un[t]=e),e}function rt(t){for(var e=0,n=0;n0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ut(t,e){if(!t)throw new Error(e)}function at(t){ut(t!==1/0,"Cannot perform this action with an infinite size.")}function st(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ct(t){this._iter=t,this.size=t.size}function ft(t){this._iter=t,this.size=t.size}function ht(t){this._iter=t,this.size=t.size}function lt(t){var e=Lt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=jt,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return e(n,t,r)!==!1},n)},e.__iteratorUncached=function(e,n){if(e===En){var r=t.__iterator(e,n);return new E(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===gn?mn:gn,n)},e}function pt(t,e,n){var r=Lt(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var o=t.get(r,ln);return o===ln?i:e.call(n,o,r,t)},r.__iterateUncached=function(r,i){var o=this;return t.__iterate(function(t,i,u){return r(e.call(n,t,i,u),i,o)!==!1},i)},r.__iteratorUncached=function(r,i){var o=t.__iterator(En,i);return new E(function(){var i=o.next();if(i.done)return i;var u=i.value,a=u[0];return I(r,a,e.call(n,u[1],a,t),i)})},r}function _t(t,e){var n=Lt(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=lt(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=jt,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function dt(t,e,n,r){var i=Lt(t);return r&&(i.has=function(r){var i=t.get(r,ln);return i!==ln&&!!e.call(n,i,r,t)},i.get=function(r,i){var o=t.get(r,ln);return o!==ln&&e.call(n,o,r,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,a=0;return t.__iterate(function(t,o,s){if(e.call(n,t,o,s))return a++,i(t,r?o:a-1,u)},o),a},i.__iteratorUncached=function(i,o){var u=t.__iterator(En,o),a=0;return new E(function(){for(;;){var o=u.next();if(o.done)return o;var s=o.value,c=s[0],f=s[1];if(e.call(n,f,c,t))return I(i,r?c:a++,f,o)}})},i}function vt(t,e,n){var r=Ut().asMutable();return t.__iterate(function(i,o){r.update(e.call(n,i,o,t),0,function(t){return t+1})}),r.asImmutable()}function yt(t,e,n){var r=y(t),i=(g(t)?be():Ut()).asMutable();t.__iterate(function(o,u){i.update(e.call(n,o,u,t),function(t){return t=t||[],t.push(r?[u,o]:o),t})});var o=Mt(t);return i.map(function(e){return Ct(t,o(e))})}function St(t,e,n,r){var i=t.size;if(void 0!==e&&(e=0|e),void 0!==n&&(n=0|n),s(e,n,i))return t;var o=c(e,i),a=f(n,i);if(o!==o||a!==a)return St(t.toSeq().cacheResult(),e,n,r);var h,l=a-o;l===l&&(h=l<0?0:l);var p=Lt(t);return p.size=0===h?h:t.size&&h||void 0,!r&&U(t)&&h>=0&&(p.get=function(e,n){return e=u(this,e),e>=0&&eh)return b();var t=i.next();return r||e===gn?t:e===mn?I(e,a-1,void 0,t):I(e,a-1,t.value[1],t)})},p}function mt(t,e,n){var r=Lt(t);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var u=0;return t.__iterate(function(t,i,a){return e.call(n,t,i,a)&&++u&&r(t,i,o)}),u},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var u=t.__iterator(En,i),a=!0;return new E(function(){if(!a)return b();var t=u.next();if(t.done)return t;var i=t.value,s=i[0],c=i[1];return e.call(n,c,s,o)?r===En?t:I(r,s,c,t):(a=!1,b())})},r}function gt(t,e,n,r){var i=Lt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var a=!0,s=0;return t.__iterate(function(t,o,c){if(!a||!(a=e.call(n,t,o,c)))return s++,i(t,r?o:s-1,u)}),s},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var a=t.__iterator(En,o),s=!0,c=0;return new E(function(){var t,o,f;do{if(t=a.next(),t.done)return r||i===gn?t:i===mn?I(i,c++,void 0,t):I(i,c++,t.value[1],t);var h=t.value;o=h[0],f=h[1],s&&(s=e.call(n,f,o,u))}while(s);return i===En?t:I(i,o,f,t)})},i}function Et(t,e){var n=y(t),r=[t].concat(e).map(function(t){return v(t)?n&&(t=p(t)):t=n?H(t):x(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===r.length)return t;if(1===r.length){var i=r[0];if(i===t||n&&y(i)||S(t)&&S(i))return i}var o=new L(r);return n?o=o.toKeyedSeq():S(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=r.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),o}function It(t,e,n){var r=Lt(t);return r.__iterateUncached=function(r,i){function o(t,s){var c=this;t.__iterate(function(t,i){return(!e||s0}function Dt(t,e,n){var r=Lt(t);return r.size=new L(n).map(function(t){return t.size}).min(),r.__iterate=function(t,e){for(var n,r=this,i=this.__iterator(gn,e),o=0;!(n=i.next()).done&&t(n.value,o++,r)!==!1;);return o},r.__iteratorUncached=function(t,r){var i=n.map(function(t){return t=l(t),T(r?t.reverse():t)}),o=0,u=!1;return new E(function(){var n;return u||(n=i.map(function(t){return t.next()}),u=n.some(function(t){return t.done})),u?b():I(t,o++,e.apply(null,n.map(function(t){return t.value})))})},r}function Ct(t,e){return U(t)?e:t.constructor(e)}function zt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Rt(t){return at(t.size),o(t)}function Mt(t){return y(t)?p:S(t)?_:d}function Lt(t){return Object.create((y(t)?z:S(t)?R:M).prototype)}function jt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):C.prototype.cacheResult.call(this)}function Nt(t,e){return t>e?1:t>>n)&hn,a=(0===n?r:r>>>n)&hn,s=u===a?[Zt(t,e,n+cn,r,i)]:(o=new Ft(e,r,i),u>>=1)u[a]=1&n?e[o++]:void 0;return u[r]=i,new Vt(t,o+1,u)}function ne(t,e,n){for(var r=[],i=0;i>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function ae(t,e,n,r){var o=r?t:i(t);return o[e]=n,o}function se(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),u=0,a=0;a0&&ro?0:o-n,c=u-n;return c>fn&&(c=fn),function(){if(i===c)return Bn;var t=e?--c:i++;return r&&r[t]}}function i(t,r,i){var a,s=t&&t.array,c=i>o?0:o-i>>r,f=(u-i>>r)+1;return f>fn&&(f=fn),function(){for(;;){if(a){var t=a();if(t!==Bn)return t;a=null}if(c===f)return Bn;var o=e?--f:c++;a=n(s&&s[o],r-cn,i+(o<=t.size||n<0)return t.withMutations(function(t){n<0?ge(t,n).set(0,r):ge(t,0,n+1).set(n,r)});n+=t._origin;var i=t._tail,o=t._root,a=e(_n);return n>=Ie(t._capacity)?i=ye(i,t.__ownerID,0,n,r,a):o=ye(o,t.__ownerID,t._level,n,r,a),a.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):_e(t._origin,t._capacity,t._level,o,i):t}function ye(t,e,r,i,o,u){var a=i>>>r&hn,s=t&&a0){var f=t&&t.array[a],h=ye(f,e,r-cn,i,o,u);return h===f?t:(c=Se(t,e),c.array[a]=h,c)}return s&&t.array[a]===o?t:(n(u),c=Se(t,e),void 0===o&&a===c.array.length-1?c.array.pop():c.array[a]=o,c)}function Se(t,e){return e&&t&&e===t.ownerID?t:new le(t?t.array.slice():[],e)}function me(t,e){if(e>=Ie(t._capacity))return t._tail;if(e<1<0;)n=n.array[e>>>r&hn],r-=cn;return n}}function ge(t,e,n){void 0!==e&&(e=0|e),void 0!==n&&(n=0|n);var i=t.__ownerID||new r,o=t._origin,u=t._capacity,a=o+e,s=void 0===n?u:n<0?u+n:o+n;if(a===o&&s===u)return t;if(a>=s)return t.clear();for(var c=t._level,f=t._root,h=0;a+h<0;)f=new le(f&&f.array.length?[void 0,f]:[],i),c+=cn,h+=1<=1<l?new le([],i):_;if(_&&p>l&&acn;y-=cn){var S=l>>>y&hn;v=v.array[S]=Se(v.array[S],i)}v.array[l>>>cn&hn]=_}if(s=p)a-=p,s-=p,c=cn,f=null,d=d&&d.removeBefore(i,0,a);else if(a>o||p>>c&hn;if(m!==p>>>c&hn)break;m&&(h+=(1<o&&(f=f.removeBefore(i,c,a-h)),f&&pi&&(i=a.size),v(u)||(a=a.map(function(t){return X(t)})),r.push(a)}return i>t.size&&(t=t.setSize(i)),ie(t,e,r)}function Ie(t){return t>>cn<=fn&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&a!==e}),r=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=a===u.size-1?u.pop():u.set(a,void 0))}else if(s){if(n===u.get(a)[1])return t;r=o,i=u.set(a,[e,n])}else r=o.set(e,u.size),i=u.set(u.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):Oe(r,i)}function De(t){return null===t||void 0===t?Re():Ce(t)?t:Re().unshiftAll(t)}function Ce(t){return!(!t||!t[Wn])}function ze(t,e,n,r){var i=Object.create(Xn);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Re(){return Qn||(Qn=ze(0))}function Me(t){return null===t||void 0===t?ke():Le(t)&&!g(t)?t:ke().withMutations(function(e){var n=d(t);at(n.size),n.forEach(function(t){return e.add(t)})})}function Le(t){return!(!t||!t[Zn])}function je(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Ne(t,e){var n=Object.create($n);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function ke(){return tr||(tr=Ne(Jt()))}function Ue(t){return null===t||void 0===t?xe():Pe(t)?t:xe().withMutations(function(e){var n=d(t);at(n.size),n.forEach(function(t){return e.add(t)})})}function Pe(t){return Le(t)&&g(t)}function He(t,e){var n=Object.create(er);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function xe(){return nr||(nr=He(Te()))}function Ve(t,e){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var u=Object.keys(t);Ge(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Ut(o)},i=r.prototype=Object.create(rr);return i.constructor=r,r}function qe(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function Fe(t){return t._name||t.constructor.name||"Record"}function Ge(t,e){try{e.forEach(Ke.bind(void 0,t))}catch(t){}}function Ke(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){ut(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Ye(t,e){if(t===e)return!0;if(!v(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||y(t)!==y(e)||S(t)!==S(e)||g(t)!==g(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!m(t);if(g(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&W(i[1],t)&&(n||W(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,a=e.__iterate(function(e,r){if(n?!t.has(e):i?!W(e,t.get(r,ln)):!W(t.get(r,ln),e))return u=!1,!1});return u&&t.size===a}function Be(t,e,n){if(!(this instanceof Be))return new Be(t,e,n);if(ut(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),ee?-1:0}function rn(t){if(t.size===1/0)return 0;var e=g(t),n=y(t),r=e?1:0,i=t.__iterate(n?e?function(t,e){r=31*r+un(et(t),et(e))|0}:function(t,e){r=r+un(et(t),et(e))|0}:e?function(t){r=31*r+et(t)|0}:function(t){r=r+et(t)|0});return on(i,r)}function on(t,e){return e=Dn(e,3432918353),e=Dn(e<<15|e>>>-15,461845907),e=Dn(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Dn(e^e>>>16,2246822507),e=Dn(e^e>>>13,3266489909),e=tt(e^e>>>16)}function un(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var an=Array.prototype.slice,sn="delete",cn=5,fn=1<r?b():I(t,i,n[e?r-i++:i++])})},t(j,z),j.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},j.prototype.has=function(t){return this._object.hasOwnProperty(t)},j.prototype.__iterate=function(t,e){for(var n=this,r=this._object,i=this._keys,o=i.length-1,u=0;u<=o;u++){var a=i[e?o-u:u];if(t(r[a],a,n)===!1)return u+1}return u},j.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,o=0;return new E(function(){var u=r[e?i-o:o];return o++>i?b():I(t,u,n[u])})},j.prototype[Sn]=!0,t(N,R),N.prototype.__iterateUncached=function(t,e){var n=this;if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,i=T(r),o=0;if(O(i))for(var u;!(u=i.next()).done&&t(u.value,o++,n)!==!1;);return o},N.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterable,r=T(n);if(!O(r))return new E(b);var i=0;return new E(function(){var e=r.next();return e.done?e:I(t,i++,e.value)})},t(k,R),k.prototype.__iterateUncached=function(t,e){var n=this;if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,i=this._iteratorCache,o=0;o=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return I(t,i,r[i++])})};var Tn;t(K,l),t(Y,K),t(B,K),t(J,K),K.Keyed=Y,K.Indexed=B,K.Set=J;var An,Dn="function"==typeof Math.imul&&Math.imul(4294967295,2)===-2?Math.imul:function(t,e){t=0|t,e=0|e;var n=65535&t,r=65535&e;return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0},Cn=Object.isExtensible,zn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),Rn="function"==typeof WeakMap;Rn&&(An=new WeakMap);var Mn=0,Ln="__immutablehash__";"function"==typeof Symbol&&(Ln=Symbol(Ln));var jn=16,Nn=255,kn=0,Un={};t(st,z),st.prototype.get=function(t,e){return this._iter.get(t,e)},st.prototype.has=function(t){return this._iter.has(t)},st.prototype.valueSeq=function(){return this._iter.valueSeq()},st.prototype.reverse=function(){var t=this,e=_t(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},st.prototype.map=function(t,e){var n=this,r=pt(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},st.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?Rt(this):0,function(i){return t(i,e?--n:n++,r)}),e)},st.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(gn,e),r=e?Rt(this):0;return new E(function(){var i=n.next();return i.done?i:I(t,e?--r:r++,i.value,i)})},st.prototype[Sn]=!0,t(ct,R),ct.prototype.includes=function(t){return this._iter.includes(t)},ct.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ct.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gn,e),r=0;return new E(function(){var e=n.next();return e.done?e:I(t,r++,e.value,e)})},t(ft,M),ft.prototype.has=function(t){return this._iter.includes(t)},ft.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ft.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gn,e);return new E(function(){var e=n.next();return e.done?e:I(t,e.value,e.value,e)})},t(ht,z),ht.prototype.entrySeq=function(){return this._iter.toSeq()},ht.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){zt(e);var r=v(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},ht.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gn,e);return new E(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){zt(r);var i=v(r);return I(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ct.prototype.cacheResult=st.prototype.cacheResult=ft.prototype.cacheResult=ht.prototype.cacheResult=jt,t(Ut,Y),Ut.prototype.toString=function(){return this.__toString("Map {","}")},Ut.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Ut.prototype.set=function(t,e){return Wt(this,t,e)},Ut.prototype.setIn=function(t,e){return this.updateIn(t,ln,function(){return e})},Ut.prototype.remove=function(t){return Wt(this,t,ln)},Ut.prototype.deleteIn=function(t){return this.updateIn(t,function(){return ln})},Ut.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},Ut.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=oe(this,kt(t),e,n);return r===ln?void 0:r},Ut.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Jt()},Ut.prototype.merge=function(){return ne(this,void 0,arguments)},Ut.prototype.mergeWith=function(t){var e=an.call(arguments,1);return ne(this,t,e)},Ut.prototype.mergeIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Jt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},Ut.prototype.mergeDeep=function(){return ne(this,re(void 0),arguments)},Ut.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return ne(this,re(t),e)},Ut.prototype.mergeDeepIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Jt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},Ut.prototype.sort=function(t){return be(Ot(this,t))},Ut.prototype.sortBy=function(t,e){return be(Ot(this,e,t))},Ut.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Ut.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new r)},Ut.prototype.asImmutable=function(){return this.__ensureOwner()},Ut.prototype.wasAltered=function(){return this.__altered},Ut.prototype.__iterator=function(t,e){return new Gt(this,t,e)},Ut.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},Ut.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Bt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ut.isMap=Pt;var Pn="@@__IMMUTABLE_MAP__@@",Hn=Ut.prototype;Hn[Pn]=!0,Hn[sn]=Hn.remove,Hn.removeIn=Hn.deleteIn,Ht.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o=Vn)return $t(t,f,o,u);var _=t&&t===this.ownerID,d=_?f:i(f);return p?c?h===l-1?d.pop():d[h]=d.pop():d[h]=[o,u]:d.push([o,u]),_?(this.entries=d,this):new Ht(t,d)}},xt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=1<<((0===t?e:e>>>t)&hn),o=this.bitmap;return 0===(o&i)?r:this.nodes[ue(o&i-1)].get(t+cn,e,n,r)},xt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&hn,s=1<=qn)return ee(t,l,c,a,_);if(f&&!_&&2===l.length&&Qt(l[1^h]))return l[1^h];if(f&&_&&1===l.length&&Qt(_))return _;var d=t&&t===this.ownerID,v=f?_?c:c^s:c|s,y=f?_?ae(l,h,_,d):ce(l,h,d):se(l,h,_,d);return d?(this.bitmap=v,this.nodes=y,this):new xt(t,v,y)},Vt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=(0===t?e:e>>>t)&hn,o=this.nodes[i];return o?o.get(t+cn,e,n,r):r},Vt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&hn,s=i===ln,c=this.nodes,f=c[a];if(s&&!f)return this;var h=Xt(f,t,e+cn,n,r,i,o,u);if(h===f)return this;var l=this.count;if(f){if(!h&&(l--,l=0&&t>>e&hn;if(r>=this.array.length)return new le([],t);var i,o=0===r;if(e>0){var u=this.array[r];if(i=u&&u.removeBefore(t,e-cn,n),i===u&&o)return this}if(o&&!i)return this;var a=Se(this,t);if(!o)for(var s=0;s>>e&hn;if(r>=this.array.length)return this;var i;if(e>0){var o=this.array[r];if(i=o&&o.removeAfter(t,e-cn,n),i===o&&r===this.array.length-1)return this}var u=Se(this,t);return u.array.splice(r+1),i&&(u.array[r]=i),u};var Yn,Bn={};t(be,Ut),be.of=function(){return this(arguments)},be.prototype.toString=function(){return this.__toString("OrderedMap {","}")},be.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},be.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Te()},be.prototype.set=function(t,e){return Ae(this,t,e)},be.prototype.remove=function(t){return Ae(this,t,ln)},be.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},be.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},be.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},be.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?Oe(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},be.isOrderedMap=we,be.prototype[Sn]=!0,be.prototype[sn]=be.prototype.remove;var Jn;t(De,B),De.of=function(){return this(arguments)},De.prototype.toString=function(){return this.__toString("Stack [","]")},De.prototype.get=function(t,e){var n=this._head;for(t=u(this,t);n&&t--;)n=n.next;return n?n.value:e},De.prototype.peek=function(){return this._head&&this._head.value},De.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,n=this._head,r=arguments.length-1;r>=0;r--)n={value:t[r],next:n};return this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):ze(e,n)},De.prototype.pushAll=function(t){if(t=_(t),0===t.size)return this;at(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):ze(e,n)},De.prototype.pop=function(){return this.slice(1)},De.prototype.unshift=function(){return this.push.apply(this,arguments)},De.prototype.unshiftAll=function(t){return this.pushAll(t)},De.prototype.shift=function(){return this.pop.apply(this,arguments)},De.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Re()},De.prototype.slice=function(t,e){if(s(t,e,this.size))return this;var n=c(t,this.size),r=f(e,this.size);if(r!==this.size)return B.prototype.slice.call(this,t,e);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):ze(i,o)},De.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?ze(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},De.prototype.__iterate=function(t,e){var n=this;if(e)return this.reverse().__iterate(t);for(var r=0,i=this._head;i&&t(i.value,r++,n)!==!1;)i=i.next;return r},De.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new E(function(){if(r){var e=r.value;return r=r.next,I(t,n++,e)}return b()})},De.isStack=Ce;var Wn="@@__IMMUTABLE_STACK__@@",Xn=De.prototype;Xn[Wn]=!0,Xn.withMutations=Hn.withMutations,Xn.asMutable=Hn.asMutable,Xn.asImmutable=Hn.asImmutable,Xn.wasAltered=Hn.wasAltered;var Qn;t(Me,J),Me.of=function(){return this(arguments)},Me.fromKeys=function(t){return this(p(t).keySeq())},Me.prototype.toString=function(){return this.__toString("Set {","}")},Me.prototype.has=function(t){return this._map.has(t)},Me.prototype.add=function(t){return je(this,this._map.set(t,!0))},Me.prototype.remove=function(t){return je(this,this._map.remove(t))},Me.prototype.clear=function(){return je(this,this._map.clear())},Me.prototype.union=function(){var t=an.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n1?" by "+this._step:"")+" ]"},Be.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e; -},Be.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e=0&&nn?b():I(t,o++,u)})},Be.prototype.equals=function(t){return t instanceof Be?this._start===t._start&&this._end===t._end&&this._step===t._step:Ye(this,t)};var ir;t(Je,R),Je.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Je.prototype.get=function(t,e){return this.has(t)?this._value:e},Je.prototype.includes=function(t){return W(this._value,t)},Je.prototype.slice=function(t,e){var n=this.size;return s(t,e,n)?this:new Je(this._value,f(e,n)-c(t,n))},Je.prototype.reverse=function(){return this},Je.prototype.indexOf=function(t){return W(this._value,t)?0:-1},Je.prototype.lastIndexOf=function(t){return W(this._value,t)?this.size:-1},Je.prototype.__iterate=function(t,e){for(var n=this,r=0;rthis.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?this.size===1/0||t-1&&t%1===0&&t<=Number.MAX_VALUE}var i=Function.prototype.bind;e.isString=function(t){return"string"==typeof t||"[object String]"===n(t)},e.isArray=Array.isArray||function(t){return"[object Array]"===n(t)},"function"!=typeof/./&&"object"!=typeof Int8Array?e.isFunction=function(t){return"function"==typeof t||!1}:e.isFunction=function(t){return"[object Function]"===toString.call(t)},e.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},e.extend=function(t){var e=arguments,n=arguments.length;if(!t||n<2)return t||{};for(var r=1;r0)){var e=this.reactorState.get("dirtyStores");if(0!==e.size){var n=c.default.Set().withMutations(function(n){n.union(t.observerState.get("any")),e.forEach(function(e){var r=t.observerState.getIn(["stores",e]);r&&n.union(r)})});n.forEach(function(e){var n=t.observerState.getIn(["observersMap",e]);if(n){var r=n.get("getter"),i=n.get("handler"),o=p.evaluate(t.prevReactorState,r),u=p.evaluate(t.reactorState,r);t.prevReactorState=o.reactorState,t.reactorState=u.reactorState;var a=o.result,s=u.result;c.default.is(a,s)||i.call(null,s)}});var r=p.resetDirtyStores(this.reactorState);this.prevReactorState=r,this.reactorState=r}}}},{key:"batchStart",value:function(){this.__batchDepth++}},{key:"batchEnd",value:function(){if(this.__batchDepth--,this.__batchDepth<=0){this.__isDispatching=!0;try{this.__notify()}catch(t){throw this.__isDispatching=!1,t}this.__isDispatching=!1}}}]),t}();e.default=(0,y.toFactory)(m),t.exports=e.default},function(t,e,n){function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n={};return(0,o.each)(e,function(e,r){n[r]=t.evaluate(e)}),n}Object.defineProperty(e,"__esModule",{value:!0});var o=n(4);e.default=function(t){return{getInitialState:function(){return i(t,this.getDataBindings())},componentDidMount:function(){var e=this;this.__unwatchFns=[],(0,o.each)(this.getDataBindings(),function(n,i){var o=t.observe(n,function(t){e.setState(r({},i,t))});e.__unwatchFns.push(o)})},componentWillUnmount:function(){for(var t=this;this.__unwatchFns.length;)t.__unwatchFns.shift()()}}},t.exports=e.default},function(t,e,n){function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){return new M({result:t,reactorState:e})}function o(t,e){return t.withMutations(function(t){(0,R.each)(e,function(e,n){t.getIn(["stores",n])&&console.warn("Store already defined for id = "+n);var r=e.getInitialState();if(void 0===r&&f(t,"throwOnUndefinedStoreReturnValue"))throw new Error("Store getInitialState() must return a value, did you forget a return statement");if(f(t,"throwOnNonImmutableStore")&&!(0,D.isImmutableValue)(r))throw new Error("Store getInitialState() must return an immutable value, did you forget to call toImmutable");t.update("stores",function(t){return t.set(n,e)}).update("state",function(t){return t.set(n,r)}).update("dirtyStores",function(t){return t.add(n)}).update("storeStates",function(t){return b(t,[n])})}),I(t)})}function u(t,e){return t.withMutations(function(t){(0,R.each)(e,function(e,n){t.update("stores",function(t){return t.set(n,e)})})})}function a(t,e,n){if(void 0===e&&f(t,"throwOnUndefinedActionType"))throw new Error("`dispatch` cannot be called with an `undefined` action type.");var r=t.get("state"),i=t.get("dirtyStores"),o=r.withMutations(function(r){A.default.dispatchStart(t,e,n),t.get("stores").forEach(function(o,u){var a=r.get(u),s=void 0;try{s=o.handle(a,e,n)}catch(e){throw A.default.dispatchError(t,e.message),e}if(void 0===s&&f(t,"throwOnUndefinedStoreReturnValue")){var c="Store handler must return a value, did you forget a return statement";throw A.default.dispatchError(t,c),new Error(c)}r.set(u,s),a!==s&&(i=i.add(u))}),A.default.dispatchEnd(t,r,i)}),u=t.set("state",o).set("dirtyStores",i).update("storeStates",function(t){return b(t,i)});return I(u)}function s(t,e){var n=[],r=(0,D.toImmutable)({}).withMutations(function(r){(0,R.each)(e,function(e,i){var o=t.getIn(["stores",i]);if(o){var u=o.deserialize(e);void 0!==u&&(r.set(i,u),n.push(i))}})}),i=O.default.Set(n);return t.update("state",function(t){return t.merge(r)}).update("dirtyStores",function(t){return t.union(i)}).update("storeStates",function(t){return b(t,n)})}function c(t,e,n){var r=e;(0,z.isKeyPath)(e)&&(e=(0,C.fromKeyPath)(e));var i=t.get("nextId"),o=(0,C.getStoreDeps)(e),u=O.default.Map({id:i,storeDeps:o,getterKey:r,getter:e,handler:n}),a=void 0;return a=0===o.size?t.update("any",function(t){return t.add(i)}):t.withMutations(function(t){o.forEach(function(e){var n=["stores",e];t.hasIn(n)||t.setIn(n,O.default.Set()),t.updateIn(["stores",e],function(t){return t.add(i)})})}),a=a.set("nextId",i+1).setIn(["observersMap",i],u),{observerState:a,entry:u}}function f(t,e){var n=t.getIn(["options",e]);if(void 0===n)throw new Error("Invalid option: "+e);return n}function h(t,e,n){var r=t.get("observersMap").filter(function(t){var r=t.get("getterKey"),i=!n||t.get("handler")===n;return!!i&&((0,z.isKeyPath)(e)&&(0,z.isKeyPath)(r)?(0,z.isEqual)(e,r):e===r)});return t.withMutations(function(t){r.forEach(function(e){return l(t,e)})})}function l(t,e){return t.withMutations(function(t){var n=e.get("id"),r=e.get("storeDeps");0===r.size?t.update("any",function(t){return t.remove(n)}):r.forEach(function(e){t.updateIn(["stores",e],function(t){return t?t.remove(n):t})}),t.removeIn(["observersMap",n])})}function p(t){var e=t.get("state");return t.withMutations(function(t){var n=t.get("stores"),r=n.keySeq().toJS();n.forEach(function(n,r){var i=e.get(r),o=n.handleReset(i);if(void 0===o&&f(t,"throwOnUndefinedStoreReturnValue"))throw new Error("Store handleReset() must return a value, did you forget a return statement");if(f(t,"throwOnNonImmutableStore")&&!(0,D.isImmutableValue)(o))throw new Error("Store reset state must be an immutable value, did you forget to call toImmutable");t.setIn(["state",r],o)}),t.update("storeStates",function(t){return b(t,r)}),v(t)})}function _(t,e){var n=t.get("state");if((0,z.isKeyPath)(e))return i(n.getIn(e),t);if(!(0,C.isGetter)(e))throw new Error("evaluate must be passed a keyPath or Getter");if(m(t,e))return i(E(t,e),t);var r=(0,C.getDeps)(e).map(function(e){return _(t,e).result}),o=(0,C.getComputeFn)(e).apply(null,r);return i(o,g(t,e,o))}function d(t){var e={};return t.get("stores").forEach(function(n,r){var i=t.getIn(["state",r]),o=n.serialize(i);void 0!==o&&(e[r]=o)}),e}function v(t){return t.set("dirtyStores",O.default.Set())}function y(t){return t}function S(t,e){var n=y(e);return t.getIn(["cache",n])}function m(t,e){var n=S(t,e);if(!n)return!1;var r=n.get("storeStates");return 0!==r.size&&r.every(function(e,n){return t.getIn(["storeStates",n])===e})}function g(t,e,n){var r=y(e),i=t.get("dispatchId"),o=(0,C.getStoreDeps)(e),u=(0,D.toImmutable)({}).withMutations(function(e){o.forEach(function(n){var r=t.getIn(["storeStates",n]);e.set(n,r)})});return t.setIn(["cache",r],O.default.Map({value:n,storeStates:u,dispatchId:i}))}function E(t,e){var n=y(e);return t.getIn(["cache",n,"value"])}function I(t){return t.update("dispatchId",function(t){return t+1})}function b(t,e){return t.withMutations(function(t){e.forEach(function(e){var n=t.has(e)?t.get(e)+1:1;t.set(e,n)})})}Object.defineProperty(e,"__esModule",{value:!0}),e.registerStores=o,e.replaceStores=u,e.dispatch=a,e.loadState=s,e.addObserver=c,e.getOption=f,e.removeObserver=h,e.removeObserverByEntry=l,e.reset=p,e.evaluate=_,e.serialize=d,e.resetDirtyStores=v;var w=n(3),O=r(w),T=n(9),A=r(T),D=n(5),C=n(10),z=n(11),R=n(4),M=O.default.Record({result:null,reactorState:null})},function(t,e,n){var r=n(8);e.dispatchStart=function(t,e,n){(0,r.getOption)(t,"logDispatches")&&console.group&&(console.groupCollapsed("Dispatch: %s",e),console.group("payload"),console.debug(n),console.groupEnd())},e.dispatchError=function(t,e){(0,r.getOption)(t,"logDispatches")&&console.group&&(console.debug("Dispatch error: "+e),console.groupEnd())},e.dispatchEnd=function(t,e,n){(0,r.getOption)(t,"logDispatches")&&console.group&&((0,r.getOption)(t,"logDirtyStores")&&console.log("Stores updated:",n.toList().toJS()),(0,r.getOption)(t,"logAppState")&&console.debug("Dispatch done, new state: ",e.toJS()),console.groupEnd())}},function(t,e,n){function r(t){return t&&t.__esModule?t:{default:t}}function i(t){return(0,l.isArray)(t)&&(0,l.isFunction)(t[t.length-1])}function o(t){return t[t.length-1]}function u(t){return t.slice(0,t.length-1)}function a(t,e){e||(e=h.default.Set());var n=h.default.Set().withMutations(function(e){if(!i(t))throw new Error("getFlattenedDeps must be passed a Getter");u(t).forEach(function(t){if((0,p.isKeyPath)(t))e.add((0,f.List)(t));else{if(!i(t))throw new Error("Invalid getter, each dependency must be a KeyPath or Getter");e.union(a(t))}})});return e.union(n)}function s(t){if(!(0,p.isKeyPath)(t))throw new Error("Cannot create Getter from KeyPath: "+t);return[t,_]}function c(t){if(t.hasOwnProperty("__storeDeps"))return t.__storeDeps;var e=a(t).map(function(t){return t.first()}).filter(function(t){return!!t});return Object.defineProperty(t,"__storeDeps",{enumerable:!1,configurable:!1,writable:!1,value:e}),e}Object.defineProperty(e,"__esModule",{value:!0});var f=n(3),h=r(f),l=n(4),p=n(11),_=function(t){return t};e.default={isGetter:i,getComputeFn:o,getFlattenedDeps:a,getStoreDeps:c,getDeps:u,fromKeyPath:s},t.exports=e.default},function(t,e,n){function r(t){return t&&t.__esModule?t:{default:t}}function i(t){return(0,s.isArray)(t)&&!(0,s.isFunction)(t[t.length-1])}function o(t,e){var n=a.default.List(t),r=a.default.List(e);return a.default.is(n,r)}Object.defineProperty(e,"__esModule",{value:!0}),e.isKeyPath=i,e.isEqual=o;var u=n(3),a=r(u),s=n(4)},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=(0,r.Map)({logDispatches:!1,logAppState:!1,logDirtyStores:!1,throwOnUndefinedActionType:!1,throwOnUndefinedStoreReturnValue:!1,throwOnNonImmutableStore:!1,throwOnDispatchInDispatch:!1});e.PROD_OPTIONS=i;var o=(0,r.Map)({logDispatches:!0,logAppState:!0,logDirtyStores:!0,throwOnUndefinedActionType:!0,throwOnUndefinedStoreReturnValue:!0,throwOnNonImmutableStore:!0,throwOnDispatchInDispatch:!0});e.DEBUG_OPTIONS=o;var u=(0,r.Record)({dispatchId:0,state:(0,r.Map)(),stores:(0,r.Map)(),cache:(0,r.Map)(),storeStates:(0,r.Map)(),dirtyStores:(0,r.Set)(),debug:!1,options:i});e.ReactorState=u;var a=(0,r.Record)({any:(0,r.Set)(),stores:(0,r.Map)({}),observersMap:(0,r.Map)({}),nextId:1});e.ObserverState=a}])})}),Ee=ge&&"object"==typeof ge&&"default"in ge?ge.default:ge,Ie=t(function(t){var e=function(t){var e,n={};if(!(t instanceof Object)||Array.isArray(t))throw new Error("keyMirror(...): Argument must be an object.");for(e in t)t.hasOwnProperty(e)&&(n[e]=e);return n};t.exports=e}),be=Ie&&"object"==typeof Ie&&"default"in Ie?Ie.default:Ie,we=be({VALIDATING_AUTH_TOKEN:null,VALID_AUTH_TOKEN:null,INVALID_AUTH_TOKEN:null,LOG_OUT:null}),Oe=Ee.Store,Te=Ee.toImmutable,Ae=new Oe({getInitialState:function(){return Te({isValidating:!1,authToken:!1,host:null,isInvalid:!1,errorMessage:""})},initialize:function(){this.on(we.VALIDATING_AUTH_TOKEN,e),this.on(we.VALID_AUTH_TOKEN,n),this.on(we.INVALID_AUTH_TOKEN,r)}}),De=Ee.Store,Ce=Ee.toImmutable,ze=new De({getInitialState:function(){return Ce({authToken:null,host:""})},initialize:function(){this.on(we.VALID_AUTH_TOKEN,i),this.on(we.LOG_OUT,o)}}),Re=Ee.Store,Me=new Re({getInitialState:function(){return!0},initialize:function(){this.on(we.VALID_AUTH_TOKEN,u)}}),Le=be({STREAM_START:null,STREAM_STOP:null,STREAM_ERROR:null}),je="object"==typeof window&&"EventSource"in window,Ne=Ee.Store,ke=Ee.toImmutable,Ue=new Ne({getInitialState:function(){return ke({isSupported:je,isStreaming:!1,useStreaming:!0,hasError:!1})},initialize:function(){this.on(Le.STREAM_START,a),this.on(Le.STREAM_STOP,s),this.on(Le.STREAM_ERROR,c),this.on(Le.LOG_OUT,f)}}),Pe=be({API_FETCH_ALL_START:null,API_FETCH_ALL_SUCCESS:null,API_FETCH_ALL_FAIL:null,SYNC_SCHEDULED:null,SYNC_SCHEDULE_CANCELLED:null}),He=Ee.Store,xe=new He({getInitialState:function(){return!0},initialize:function(){this.on(Pe.API_FETCH_ALL_START,function(){return!0}),this.on(Pe.API_FETCH_ALL_SUCCESS,function(){return!1}),this.on(Pe.API_FETCH_ALL_FAIL,function(){return!1}),this.on(Pe.LOG_OUT,function(){return!1})}}),Ve=Ee.Store,qe=new Ve({getInitialState:function(){return!1},initialize:function(){this.on(Pe.SYNC_SCHEDULED,function(){return!0}),this.on(Pe.SYNC_SCHEDULE_CANCELLED,function(){return!1}),this.on(Pe.LOG_OUT,function(){return!1})}}),Fe=be({API_FETCH_SUCCESS:null,API_FETCH_START:null,API_FETCH_FAIL:null,API_SAVE_SUCCESS:null,API_SAVE_START:null,API_SAVE_FAIL:null,API_DELETE_SUCCESS:null,API_DELETE_START:null,API_DELETE_FAIL:null,LOG_OUT:null}),Ge=Ee.Store,Ke=Ee.toImmutable,Ye=new Ge({getInitialState:function(){return Ke({})},initialize:function(){var t=this;this.on(Fe.API_FETCH_SUCCESS,h),this.on(Fe.API_SAVE_SUCCESS,h),this.on(Fe.API_DELETE_SUCCESS,l),this.on(Fe.LOG_OUT,function(){return t.getInitialState()})}}),Be=t(function(t){function e(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function n(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=n()?Object.assign:function(t,n){for(var o,u,a=arguments,s=e(t),c=1;c0?i=setTimeout(r,e-c):(i=null,n||(s=t.apply(u,o),i||(u=o=null)))}var i,o,u,a,s;null==e&&(e=100);var c=function(){u=this,o=arguments,a=(new Date).getTime();var c=n&&!i;return i||(i=setTimeout(r,e)),c&&(s=t.apply(u,o),u=o=null),s};return c.clear=function(){i&&(clearTimeout(i),i=null)},c}function N(t,e){var n=e.component;return t.push(n)}function k(t,e){var n=e.components;return ur(n)}function U(){return ar.getInitialState()}function P(t,e){var n=e.latitude,r=e.longitude,i=e.location_name,o=e.temperature_unit,u=e.time_zone,a=e.version;return cr({latitude:n,longitude:r,location_name:i,temperature_unit:o,time_zone:u,serverVersion:a})}function H(){return fr.getInitialState()}function x(t,e){t.dispatch(ir.SERVER_CONFIG_LOADED,e)}function V(t){nn(t,"GET","config").then(function(e){return x(t,e)})}function q(t,e){t.dispatch(ir.COMPONENT_LOADED,{component:e})}function F(t){return[["serverComponent"],function(e){return e.contains(t)}]}function G(t){t.registerStores({serverComponent:ar,serverConfig:fr})}function K(t,e){var n=e.pane;return n}function Y(){return Er.getInitialState()}function B(t,e){var n=e.panels;return br(n)}function J(){return Or.getInitialState()}function W(t,e){var n=e.show;return!!n}function X(){return Tr.getInitialState()}function Q(t,e){t.dispatch(mr.SHOW_SIDEBAR,{show:e})}function Z(t,e){t.dispatch(mr.NAVIGATE,{pane:e})}function $(t,e){t.dispatch(mr.PANELS_LOADED,{panels:e})}function tt(t,e){var n=e.entityId;return n}function et(){return Nr.getInitialState()}function nt(t,e){t.dispatch(Lr.SELECT_ENTITY,{entityId:e})}function rt(t){t.dispatch(Lr.SELECT_ENTITY,{entityId:null})}function it(t){return!t||(new Date).getTime()-t>6e4}function ot(t,e){var n=e.date;return n.toISOString()}function ut(){return Hr.getInitialState()}function at(t,e){var n=e.date,r=e.stateHistory;return 0===r.length?t.set(n,Vr({})):t.withMutations(function(t){r.forEach(function(e){return t.setIn([n,e[0].entity_id],Vr(e.map(sn.fromJSON)))})})}function st(){return qr.getInitialState()}function ct(t,e){var n=e.stateHistory;return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,Yr(e.map(sn.fromJSON)))})})}function ft(){return Br.getInitialState()}function ht(t,e){var n=e.stateHistory,r=(new Date).getTime();return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,r)}),history.length>1&&t.set(Xr,r)})}function lt(){return Qr.getInitialState()}function pt(t,e){t.dispatch(Ur.ENTITY_HISTORY_DATE_SELECTED,{date:e})}function _t(t,e){void 0===e&&(e=null),t.dispatch(Ur.RECENT_ENTITY_HISTORY_FETCH_START,{});var n="history/period";return null!==e&&(n+="?filter_entity_id="+e),nn(t,"GET",n).then(function(e){return t.dispatch(Ur.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,{stateHistory:e})},function(){return t.dispatch(Ur.RECENT_ENTITY_HISTORY_FETCH_ERROR,{})})}function dt(t,e){return t.dispatch(Ur.ENTITY_HISTORY_FETCH_START,{date:e}),nn(t,"GET","history/period/"+e).then(function(n){return t.dispatch(Ur.ENTITY_HISTORY_FETCH_SUCCESS,{date:e,stateHistory:n})},function(){return t.dispatch(Ur.ENTITY_HISTORY_FETCH_ERROR,{})})}function vt(t){var e=t.evaluate(ti);return dt(t,e)}function yt(t){t.registerStores({currentEntityHistoryDate:Hr,entityHistory:qr,isLoadingEntityHistory:Gr,recentEntityHistory:Br,recentEntityHistoryUpdated:Qr})}function St(t){t.registerStores({moreInfoEntityId:Nr})}function mt(t,e){var n=e.model,r=e.result,i=e.params;if(null===t||"entity"!==n.entity||!i.replace)return t;for(var o=0;oXo}function ue(t){t.registerStores({currentLogbookDate:ko,isLoadingLogbookEntries:Po,logbookEntries:Go,logbookEntriesUpdated:Bo})}function ae(t,e){return nn(t,"POST","template",{template:e})}function se(t){return t.set("isListening",!0)}function ce(t,e){var n=e.interimTranscript,r=e.finalTranscript;return t.withMutations(function(t){return t.set("isListening",!0).set("isTransmitting",!1).set("interimTranscript",n).set("finalTranscript",r)})}function fe(t,e){var n=e.finalTranscript;return t.withMutations(function(t){return t.set("isListening",!1).set("isTransmitting",!0).set("interimTranscript","").set("finalTranscript",n)})}function he(){return pu.getInitialState()}function le(){return pu.getInitialState()}function pe(){return pu.getInitialState()}function _e(t){return _u[t.hassId]}function de(t){var e=_e(t);if(e){var n=e.finalTranscript||e.interimTranscript;t.dispatch(fu.VOICE_TRANSMITTING,{finalTranscript:n}),Qn.callService(t,"conversation","process",{text:n}).then(function(){t.dispatch(fu.VOICE_DONE)},function(){t.dispatch(fu.VOICE_ERROR)})}}function ve(t){var e=_e(t);e&&(e.recognition.stop(),_u[t.hassId]=!1)}function ye(t){de(t),ve(t)}function Se(t){var e=ye.bind(null,t);e();var n=new webkitSpeechRecognition;_u[t.hassId]={recognition:n,interimTranscript:"",finalTranscript:""},n.interimResults=!0,n.onstart=function(){return t.dispatch(fu.VOICE_START)},n.onerror=function(){return t.dispatch(fu.VOICE_ERROR)},n.onend=e,n.onresult=function(e){var n=_e(t);if(n){for(var r="",i="",o=e.resultIndex;o=n)}function c(t,e){return h(t,e,0)}function f(t,e){return h(t,e,e)}function h(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function l(t){return v(t)?t:C(t)}function p(t){return y(t)?t:z(t)}function _(t){return S(t)?t:R(t)}function d(t){return v(t)&&!m(t)?t:M(t)}function v(t){return!(!t||!t[dn])}function y(t){return!(!t||!t[vn])}function S(t){return!(!t||!t[yn])}function m(t){return y(t)||S(t)}function g(t){return!(!t||!t[Sn])}function E(t){this.next=t}function I(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function b(){return{value:void 0,done:!0}}function O(t){return!!A(t)}function w(t){return t&&"function"==typeof t.next}function T(t){var e=A(t);return e&&e.call(t)}function A(t){var e=t&&(In&&t[In]||t[bn]);if("function"==typeof e)return e}function D(t){return t&&"number"==typeof t.length}function C(t){return null===t||void 0===t?P():v(t)?t.toSeq():V(t)}function z(t){return null===t||void 0===t?P().toKeyedSeq():v(t)?y(t)?t.toSeq():t.fromEntrySeq():H(t)}function R(t){return null===t||void 0===t?P():v(t)?y(t)?t.entrySeq():t.toIndexedSeq():x(t)}function M(t){return(null===t||void 0===t?P():v(t)?y(t)?t.entrySeq():t:x(t)).toSetSeq()}function L(t){this._array=t,this.size=t.length}function j(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function N(t){this._iterable=t,this.size=t.length||t.size}function k(t){this._iterator=t,this._iteratorCache=[]}function U(t){return!(!t||!t[wn])}function P(){return Tn||(Tn=new L([]))}function H(t){var e=Array.isArray(t)?new L(t).fromEntrySeq():w(t)?new k(t).fromEntrySeq():O(t)?new N(t).fromEntrySeq():"object"==typeof t?new j(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function x(t){var e=q(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function V(t){var e=q(t)||"object"==typeof t&&new j(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function q(t){return D(t)?new L(t):w(t)?new k(t):O(t)?new N(t):void 0}function F(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;u<=o;u++){var a=i[n?o-u:u];if(e(a[1],r?a[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,n)}function G(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new E(function(){var t=i[n?o-u:u];return u++>o?b():I(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function K(){throw TypeError("Abstract")}function Y(){}function B(){}function J(){}function W(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function X(t,e){return e?Q(e,t,"",{"":t}):Z(t)}function Q(t,e,n,r){return Array.isArray(e)?t.call(r,n,R(e).map(function(n,r){return Q(t,n,r,e)})):$(e)?t.call(r,n,z(e).map(function(n,r){return Q(t,n,r,e)})):e}function Z(t){return Array.isArray(t)?R(t).map(Z).toList():$(t)?z(t).map(Z).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return tt(n)}return"string"===e?t.length>jn?nt(t):rt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function nt(t){var e=Un[t];return void 0===e&&(e=rt(t),kn===Nn&&(kn=0,Un={}),kn++,Un[t]=e),e}function rt(t){for(var e=0,n=0;n0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ut(t,e){if(!t)throw new Error(e)}function at(t){ut(t!==1/0,"Cannot perform this action with an infinite size.")}function st(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ct(t){this._iter=t,this.size=t.size}function ft(t){this._iter=t,this.size=t.size}function ht(t){this._iter=t,this.size=t.size}function lt(t){var e=Lt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=jt,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return e(n,t,r)!==!1},n)},e.__iteratorUncached=function(e,n){if(e===En){var r=t.__iterator(e,n);return new E(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===gn?mn:gn,n)},e}function pt(t,e,n){var r=Lt(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var o=t.get(r,ln);return o===ln?i:e.call(n,o,r,t)},r.__iterateUncached=function(r,i){var o=this;return t.__iterate(function(t,i,u){return r(e.call(n,t,i,u),i,o)!==!1},i)},r.__iteratorUncached=function(r,i){var o=t.__iterator(En,i);return new E(function(){var i=o.next();if(i.done)return i;var u=i.value,a=u[0];return I(r,a,e.call(n,u[1],a,t),i)})},r}function _t(t,e){var n=Lt(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=lt(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=jt,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function dt(t,e,n,r){var i=Lt(t);return r&&(i.has=function(r){var i=t.get(r,ln);return i!==ln&&!!e.call(n,i,r,t)},i.get=function(r,i){var o=t.get(r,ln);return o!==ln&&e.call(n,o,r,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,a=0;return t.__iterate(function(t,o,s){if(e.call(n,t,o,s))return a++,i(t,r?o:a-1,u)},o),a},i.__iteratorUncached=function(i,o){var u=t.__iterator(En,o),a=0;return new E(function(){for(;;){var o=u.next();if(o.done)return o;var s=o.value,c=s[0],f=s[1];if(e.call(n,f,c,t))return I(i,r?c:a++,f,o)}})},i}function vt(t,e,n){var r=Ut().asMutable();return t.__iterate(function(i,o){r.update(e.call(n,i,o,t),0,function(t){return t+1})}),r.asImmutable()}function yt(t,e,n){var r=y(t),i=(g(t)?be():Ut()).asMutable();t.__iterate(function(o,u){i.update(e.call(n,o,u,t),function(t){return t=t||[],t.push(r?[u,o]:o),t})});var o=Mt(t);return i.map(function(e){return Ct(t,o(e))})}function St(t,e,n,r){var i=t.size;if(void 0!==e&&(e=0|e),void 0!==n&&(n=0|n),s(e,n,i))return t;var o=c(e,i),a=f(n,i);if(o!==o||a!==a)return St(t.toSeq().cacheResult(),e,n,r);var h,l=a-o;l===l&&(h=l<0?0:l);var p=Lt(t);return p.size=0===h?h:t.size&&h||void 0,!r&&U(t)&&h>=0&&(p.get=function(e,n){return e=u(this,e),e>=0&&eh)return b();var t=i.next();return r||e===gn?t:e===mn?I(e,a-1,void 0,t):I(e,a-1,t.value[1],t)})},p}function mt(t,e,n){var r=Lt(t);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var u=0;return t.__iterate(function(t,i,a){return e.call(n,t,i,a)&&++u&&r(t,i,o)}),u},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var u=t.__iterator(En,i),a=!0;return new E(function(){if(!a)return b();var t=u.next();if(t.done)return t;var i=t.value,s=i[0],c=i[1];return e.call(n,c,s,o)?r===En?t:I(r,s,c,t):(a=!1,b())})},r}function gt(t,e,n,r){var i=Lt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var a=!0,s=0;return t.__iterate(function(t,o,c){if(!a||!(a=e.call(n,t,o,c)))return s++,i(t,r?o:s-1,u)}),s},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var a=t.__iterator(En,o),s=!0,c=0;return new E(function(){var t,o,f;do{if(t=a.next(),t.done)return r||i===gn?t:i===mn?I(i,c++,void 0,t):I(i,c++,t.value[1],t);var h=t.value;o=h[0],f=h[1],s&&(s=e.call(n,f,o,u))}while(s);return i===En?t:I(i,o,f,t)})},i}function Et(t,e){var n=y(t),r=[t].concat(e).map(function(t){return v(t)?n&&(t=p(t)):t=n?H(t):x(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===r.length)return t;if(1===r.length){var i=r[0];if(i===t||n&&y(i)||S(t)&&S(i))return i}var o=new L(r);return n?o=o.toKeyedSeq():S(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=r.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),o}function It(t,e,n){var r=Lt(t);return r.__iterateUncached=function(r,i){function o(t,s){var c=this;t.__iterate(function(t,i){return(!e||s0}function Dt(t,e,n){var r=Lt(t);return r.size=new L(n).map(function(t){return t.size}).min(),r.__iterate=function(t,e){for(var n,r=this,i=this.__iterator(gn,e),o=0;!(n=i.next()).done&&t(n.value,o++,r)!==!1;);return o},r.__iteratorUncached=function(t,r){var i=n.map(function(t){return t=l(t),T(r?t.reverse():t)}),o=0,u=!1;return new E(function(){var n;return u||(n=i.map(function(t){return t.next()}),u=n.some(function(t){return t.done})),u?b():I(t,o++,e.apply(null,n.map(function(t){return t.value})))})},r}function Ct(t,e){return U(t)?e:t.constructor(e)}function zt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Rt(t){return at(t.size),o(t)}function Mt(t){return y(t)?p:S(t)?_:d}function Lt(t){return Object.create((y(t)?z:S(t)?R:M).prototype)}function jt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):C.prototype.cacheResult.call(this)}function Nt(t,e){return t>e?1:t>>n)&hn,a=(0===n?r:r>>>n)&hn,s=u===a?[Zt(t,e,n+cn,r,i)]:(o=new Ft(e,r,i),u>>=1)u[a]=1&n?e[o++]:void 0;return u[r]=i,new Vt(t,o+1,u)}function ne(t,e,n){for(var r=[],i=0;i>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function ae(t,e,n,r){var o=r?t:i(t);return o[e]=n,o}function se(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),u=0,a=0;a0&&ro?0:o-n,c=u-n;return c>fn&&(c=fn),function(){if(i===c)return Bn;var t=e?--c:i++;return r&&r[t]}}function i(t,r,i){var a,s=t&&t.array,c=i>o?0:o-i>>r,f=(u-i>>r)+1;return f>fn&&(f=fn),function(){for(;;){if(a){var t=a();if(t!==Bn)return t;a=null}if(c===f)return Bn;var o=e?--f:c++;a=n(s&&s[o],r-cn,i+(o<=t.size||n<0)return t.withMutations(function(t){n<0?ge(t,n).set(0,r):ge(t,0,n+1).set(n,r)});n+=t._origin;var i=t._tail,o=t._root,a=e(_n);return n>=Ie(t._capacity)?i=ye(i,t.__ownerID,0,n,r,a):o=ye(o,t.__ownerID,t._level,n,r,a),a.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):_e(t._origin,t._capacity,t._level,o,i):t}function ye(t,e,r,i,o,u){var a=i>>>r&hn,s=t&&a0){var f=t&&t.array[a],h=ye(f,e,r-cn,i,o,u);return h===f?t:(c=Se(t,e),c.array[a]=h,c)}return s&&t.array[a]===o?t:(n(u),c=Se(t,e),void 0===o&&a===c.array.length-1?c.array.pop():c.array[a]=o,c)}function Se(t,e){return e&&t&&e===t.ownerID?t:new le(t?t.array.slice():[],e)}function me(t,e){if(e>=Ie(t._capacity))return t._tail;if(e<1<0;)n=n.array[e>>>r&hn],r-=cn;return n}}function ge(t,e,n){void 0!==e&&(e=0|e),void 0!==n&&(n=0|n);var i=t.__ownerID||new r,o=t._origin,u=t._capacity,a=o+e,s=void 0===n?u:n<0?u+n:o+n;if(a===o&&s===u)return t;if(a>=s)return t.clear();for(var c=t._level,f=t._root,h=0;a+h<0;)f=new le(f&&f.array.length?[void 0,f]:[],i),c+=cn,h+=1<=1<l?new le([],i):_;if(_&&p>l&&acn;y-=cn){var S=l>>>y&hn;v=v.array[S]=Se(v.array[S],i)}v.array[l>>>cn&hn]=_}if(s=p)a-=p,s-=p,c=cn,f=null,d=d&&d.removeBefore(i,0,a);else if(a>o||p>>c&hn;if(m!==p>>>c&hn)break;m&&(h+=(1<o&&(f=f.removeBefore(i,c,a-h)),f&&pi&&(i=a.size),v(u)||(a=a.map(function(t){return X(t)})),r.push(a)}return i>t.size&&(t=t.setSize(i)),ie(t,e,r)}function Ie(t){return t>>cn<=fn&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&a!==e}),r=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=a===u.size-1?u.pop():u.set(a,void 0))}else if(s){if(n===u.get(a)[1])return t;r=o,i=u.set(a,[e,n])}else r=o.set(e,u.size),i=u.set(u.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):we(r,i)}function De(t){return null===t||void 0===t?Re():Ce(t)?t:Re().unshiftAll(t)}function Ce(t){return!(!t||!t[Wn])}function ze(t,e,n,r){var i=Object.create(Xn);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Re(){return Qn||(Qn=ze(0))}function Me(t){return null===t||void 0===t?ke():Le(t)&&!g(t)?t:ke().withMutations(function(e){var n=d(t);at(n.size),n.forEach(function(t){return e.add(t)})})}function Le(t){return!(!t||!t[Zn])}function je(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Ne(t,e){var n=Object.create($n);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function ke(){return tr||(tr=Ne(Jt()))}function Ue(t){return null===t||void 0===t?xe():Pe(t)?t:xe().withMutations(function(e){var n=d(t);at(n.size),n.forEach(function(t){return e.add(t)})})}function Pe(t){return Le(t)&&g(t)}function He(t,e){var n=Object.create(er);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function xe(){return nr||(nr=He(Te()))}function Ve(t,e){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var u=Object.keys(t);Ge(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Ut(o)},i=r.prototype=Object.create(rr);return i.constructor=r,r}function qe(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function Fe(t){return t._name||t.constructor.name||"Record"}function Ge(t,e){try{e.forEach(Ke.bind(void 0,t))}catch(t){}}function Ke(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){ut(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Ye(t,e){if(t===e)return!0;if(!v(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||y(t)!==y(e)||S(t)!==S(e)||g(t)!==g(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!m(t);if(g(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&W(i[1],t)&&(n||W(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,a=e.__iterate(function(e,r){if(n?!t.has(e):i?!W(e,t.get(r,ln)):!W(t.get(r,ln),e))return u=!1,!1});return u&&t.size===a}function Be(t,e,n){if(!(this instanceof Be))return new Be(t,e,n);if(ut(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),ee?-1:0}function rn(t){if(t.size===1/0)return 0;var e=g(t),n=y(t),r=e?1:0,i=t.__iterate(n?e?function(t,e){r=31*r+un(et(t),et(e))|0}:function(t,e){r=r+un(et(t),et(e))|0}:e?function(t){r=31*r+et(t)|0}:function(t){r=r+et(t)|0});return on(i,r)}function on(t,e){return e=Dn(e,3432918353),e=Dn(e<<15|e>>>-15,461845907),e=Dn(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Dn(e^e>>>16,2246822507),e=Dn(e^e>>>13,3266489909),e=tt(e^e>>>16)}function un(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var an=Array.prototype.slice,sn="delete",cn=5,fn=1<r?b():I(t,i,n[e?r-i++:i++])})},t(j,z),j.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},j.prototype.has=function(t){return this._object.hasOwnProperty(t)},j.prototype.__iterate=function(t,e){for(var n=this,r=this._object,i=this._keys,o=i.length-1,u=0;u<=o;u++){var a=i[e?o-u:u];if(t(r[a],a,n)===!1)return u+1}return u},j.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,o=0;return new E(function(){var u=r[e?i-o:o];return o++>i?b():I(t,u,n[u])})},j.prototype[Sn]=!0,t(N,R),N.prototype.__iterateUncached=function(t,e){var n=this;if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,i=T(r),o=0;if(w(i))for(var u;!(u=i.next()).done&&t(u.value,o++,n)!==!1;);return o},N.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterable,r=T(n);if(!w(r))return new E(b);var i=0;return new E(function(){var e=r.next();return e.done?e:I(t,i++,e.value)})},t(k,R),k.prototype.__iterateUncached=function(t,e){var n=this;if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,i=this._iteratorCache,o=0;o=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return I(t,i,r[i++])})};var Tn;t(K,l),t(Y,K),t(B,K),t(J,K),K.Keyed=Y,K.Indexed=B,K.Set=J;var An,Dn="function"==typeof Math.imul&&Math.imul(4294967295,2)===-2?Math.imul:function(t,e){t=0|t,e=0|e;var n=65535&t,r=65535&e;return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0},Cn=Object.isExtensible,zn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),Rn="function"==typeof WeakMap;Rn&&(An=new WeakMap);var Mn=0,Ln="__immutablehash__";"function"==typeof Symbol&&(Ln=Symbol(Ln));var jn=16,Nn=255,kn=0,Un={};t(st,z),st.prototype.get=function(t,e){return this._iter.get(t,e)},st.prototype.has=function(t){return this._iter.has(t)},st.prototype.valueSeq=function(){return this._iter.valueSeq()},st.prototype.reverse=function(){var t=this,e=_t(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},st.prototype.map=function(t,e){var n=this,r=pt(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},st.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?Rt(this):0,function(i){return t(i,e?--n:n++,r)}),e)},st.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(gn,e),r=e?Rt(this):0;return new E(function(){var i=n.next();return i.done?i:I(t,e?--r:r++,i.value,i)})},st.prototype[Sn]=!0,t(ct,R),ct.prototype.includes=function(t){return this._iter.includes(t)},ct.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ct.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gn,e),r=0;return new E(function(){var e=n.next();return e.done?e:I(t,r++,e.value,e)})},t(ft,M),ft.prototype.has=function(t){return this._iter.includes(t)},ft.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ft.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gn,e);return new E(function(){var e=n.next();return e.done?e:I(t,e.value,e.value,e)})},t(ht,z),ht.prototype.entrySeq=function(){return this._iter.toSeq()},ht.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){zt(e);var r=v(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},ht.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gn,e);return new E(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){zt(r);var i=v(r);return I(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ct.prototype.cacheResult=st.prototype.cacheResult=ft.prototype.cacheResult=ht.prototype.cacheResult=jt,t(Ut,Y),Ut.prototype.toString=function(){return this.__toString("Map {","}")},Ut.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Ut.prototype.set=function(t,e){return Wt(this,t,e)},Ut.prototype.setIn=function(t,e){return this.updateIn(t,ln,function(){return e})},Ut.prototype.remove=function(t){return Wt(this,t,ln)},Ut.prototype.deleteIn=function(t){return this.updateIn(t,function(){return ln})},Ut.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},Ut.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=oe(this,kt(t),e,n);return r===ln?void 0:r},Ut.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Jt()},Ut.prototype.merge=function(){return ne(this,void 0,arguments)},Ut.prototype.mergeWith=function(t){var e=an.call(arguments,1);return ne(this,t,e)},Ut.prototype.mergeIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Jt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},Ut.prototype.mergeDeep=function(){return ne(this,re(void 0),arguments)},Ut.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return ne(this,re(t),e)},Ut.prototype.mergeDeepIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Jt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},Ut.prototype.sort=function(t){return be(wt(this,t))},Ut.prototype.sortBy=function(t,e){return be(wt(this,e,t))},Ut.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Ut.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new r)},Ut.prototype.asImmutable=function(){return this.__ensureOwner()},Ut.prototype.wasAltered=function(){return this.__altered},Ut.prototype.__iterator=function(t,e){return new Gt(this,t,e)},Ut.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},Ut.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Bt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ut.isMap=Pt;var Pn="@@__IMMUTABLE_MAP__@@",Hn=Ut.prototype;Hn[Pn]=!0,Hn[sn]=Hn.remove,Hn.removeIn=Hn.deleteIn,Ht.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o=Vn)return $t(t,f,o,u);var _=t&&t===this.ownerID,d=_?f:i(f);return p?c?h===l-1?d.pop():d[h]=d.pop():d[h]=[o,u]:d.push([o,u]),_?(this.entries=d,this):new Ht(t,d)}},xt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=1<<((0===t?e:e>>>t)&hn),o=this.bitmap;return 0===(o&i)?r:this.nodes[ue(o&i-1)].get(t+cn,e,n,r)},xt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&hn,s=1<=qn)return ee(t,l,c,a,_);if(f&&!_&&2===l.length&&Qt(l[1^h]))return l[1^h];if(f&&_&&1===l.length&&Qt(_))return _;var d=t&&t===this.ownerID,v=f?_?c:c^s:c|s,y=f?_?ae(l,h,_,d):ce(l,h,d):se(l,h,_,d);return d?(this.bitmap=v,this.nodes=y,this):new xt(t,v,y)},Vt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=(0===t?e:e>>>t)&hn,o=this.nodes[i];return o?o.get(t+cn,e,n,r):r},Vt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&hn,s=i===ln,c=this.nodes,f=c[a];if(s&&!f)return this;var h=Xt(f,t,e+cn,n,r,i,o,u);if(h===f)return this;var l=this.count;if(f){if(!h&&(l--,l=0&&t>>e&hn;if(r>=this.array.length)return new le([],t);var i,o=0===r;if(e>0){var u=this.array[r];if(i=u&&u.removeBefore(t,e-cn,n),i===u&&o)return this}if(o&&!i)return this;var a=Se(this,t);if(!o)for(var s=0;s>>e&hn;if(r>=this.array.length)return this;var i;if(e>0){var o=this.array[r];if(i=o&&o.removeAfter(t,e-cn,n),i===o&&r===this.array.length-1)return this}var u=Se(this,t);return u.array.splice(r+1),i&&(u.array[r]=i),u};var Yn,Bn={};t(be,Ut),be.of=function(){return this(arguments)},be.prototype.toString=function(){return this.__toString("OrderedMap {","}")},be.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},be.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Te()},be.prototype.set=function(t,e){return Ae(this,t,e)},be.prototype.remove=function(t){return Ae(this,t,ln)},be.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},be.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},be.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},be.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?we(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},be.isOrderedMap=Oe,be.prototype[Sn]=!0,be.prototype[sn]=be.prototype.remove;var Jn;t(De,B),De.of=function(){return this(arguments)},De.prototype.toString=function(){return this.__toString("Stack [","]")},De.prototype.get=function(t,e){var n=this._head;for(t=u(this,t);n&&t--;)n=n.next;return n?n.value:e},De.prototype.peek=function(){return this._head&&this._head.value},De.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,n=this._head,r=arguments.length-1;r>=0;r--)n={value:t[r],next:n};return this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):ze(e,n)},De.prototype.pushAll=function(t){if(t=_(t),0===t.size)return this;at(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):ze(e,n)},De.prototype.pop=function(){return this.slice(1)},De.prototype.unshift=function(){return this.push.apply(this,arguments)},De.prototype.unshiftAll=function(t){return this.pushAll(t)},De.prototype.shift=function(){return this.pop.apply(this,arguments)},De.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Re()},De.prototype.slice=function(t,e){if(s(t,e,this.size))return this;var n=c(t,this.size),r=f(e,this.size);if(r!==this.size)return B.prototype.slice.call(this,t,e);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):ze(i,o)},De.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?ze(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},De.prototype.__iterate=function(t,e){var n=this;if(e)return this.reverse().__iterate(t);for(var r=0,i=this._head;i&&t(i.value,r++,n)!==!1;)i=i.next;return r},De.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new E(function(){if(r){var e=r.value;return r=r.next,I(t,n++,e)}return b()})},De.isStack=Ce;var Wn="@@__IMMUTABLE_STACK__@@",Xn=De.prototype;Xn[Wn]=!0,Xn.withMutations=Hn.withMutations,Xn.asMutable=Hn.asMutable,Xn.asImmutable=Hn.asImmutable,Xn.wasAltered=Hn.wasAltered;var Qn;t(Me,J),Me.of=function(){return this(arguments)},Me.fromKeys=function(t){return this(p(t).keySeq())},Me.prototype.toString=function(){return this.__toString("Set {","}")},Me.prototype.has=function(t){return this._map.has(t)},Me.prototype.add=function(t){return je(this,this._map.set(t,!0))},Me.prototype.remove=function(t){return je(this,this._map.remove(t))},Me.prototype.clear=function(){return je(this,this._map.clear())},Me.prototype.union=function(){var t=an.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n1?" by "+this._step:"")+" ]"},Be.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e; +},Be.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e=0&&nn?b():I(t,o++,u)})},Be.prototype.equals=function(t){return t instanceof Be?this._start===t._start&&this._end===t._end&&this._step===t._step:Ye(this,t)};var ir;t(Je,R),Je.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Je.prototype.get=function(t,e){return this.has(t)?this._value:e},Je.prototype.includes=function(t){return W(this._value,t)},Je.prototype.slice=function(t,e){var n=this.size;return s(t,e,n)?this:new Je(this._value,f(e,n)-c(t,n))},Je.prototype.reverse=function(){return this},Je.prototype.indexOf=function(t){return W(this._value,t)?0:-1},Je.prototype.lastIndexOf=function(t){return W(this._value,t)?this.size:-1},Je.prototype.__iterate=function(t,e){for(var n=this,r=0;rthis.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?this.size===1/0||t-1&&t%1===0&&t<=Number.MAX_VALUE}var i=Function.prototype.bind;e.isString=function(t){return"string"==typeof t||"[object String]"===n(t)},e.isArray=Array.isArray||function(t){return"[object Array]"===n(t)},"function"!=typeof/./&&"object"!=typeof Int8Array?e.isFunction=function(t){return"function"==typeof t||!1}:e.isFunction=function(t){return"[object Function]"===toString.call(t)},e.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},e.extend=function(t){var e=arguments,n=arguments.length;if(!t||n<2)return t||{};for(var r=1;r0)){var e=this.reactorState.get("dirtyStores");if(0!==e.size){var n=c.default.Set().withMutations(function(n){n.union(t.observerState.get("any")),e.forEach(function(e){var r=t.observerState.getIn(["stores",e]);r&&n.union(r)})});n.forEach(function(e){var n=t.observerState.getIn(["observersMap",e]);if(n){var r=n.get("getter"),i=n.get("handler"),o=p.evaluate(t.prevReactorState,r),u=p.evaluate(t.reactorState,r);t.prevReactorState=o.reactorState,t.reactorState=u.reactorState;var a=o.result,s=u.result;c.default.is(a,s)||i.call(null,s)}});var r=p.resetDirtyStores(this.reactorState);this.prevReactorState=r,this.reactorState=r}}}},{key:"batchStart",value:function(){this.__batchDepth++}},{key:"batchEnd",value:function(){if(this.__batchDepth--,this.__batchDepth<=0){this.__isDispatching=!0;try{this.__notify()}catch(t){throw this.__isDispatching=!1,t}this.__isDispatching=!1}}}]),t}();e.default=(0,y.toFactory)(m),t.exports=e.default},function(t,e,n){function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n={};return(0,o.each)(e,function(e,r){n[r]=t.evaluate(e)}),n}Object.defineProperty(e,"__esModule",{value:!0});var o=n(4);e.default=function(t){return{getInitialState:function(){return i(t,this.getDataBindings())},componentDidMount:function(){var e=this;this.__unwatchFns=[],(0,o.each)(this.getDataBindings(),function(n,i){var o=t.observe(n,function(t){e.setState(r({},i,t))});e.__unwatchFns.push(o)})},componentWillUnmount:function(){for(var t=this;this.__unwatchFns.length;)t.__unwatchFns.shift()()}}},t.exports=e.default},function(t,e,n){function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){return new M({result:t,reactorState:e})}function o(t,e){return t.withMutations(function(t){(0,R.each)(e,function(e,n){t.getIn(["stores",n])&&console.warn("Store already defined for id = "+n);var r=e.getInitialState();if(void 0===r&&f(t,"throwOnUndefinedStoreReturnValue"))throw new Error("Store getInitialState() must return a value, did you forget a return statement");if(f(t,"throwOnNonImmutableStore")&&!(0,D.isImmutableValue)(r))throw new Error("Store getInitialState() must return an immutable value, did you forget to call toImmutable");t.update("stores",function(t){return t.set(n,e)}).update("state",function(t){return t.set(n,r)}).update("dirtyStores",function(t){return t.add(n)}).update("storeStates",function(t){return b(t,[n])})}),I(t)})}function u(t,e){return t.withMutations(function(t){(0,R.each)(e,function(e,n){t.update("stores",function(t){return t.set(n,e)})})})}function a(t,e,n){if(void 0===e&&f(t,"throwOnUndefinedActionType"))throw new Error("`dispatch` cannot be called with an `undefined` action type.");var r=t.get("state"),i=t.get("dirtyStores"),o=r.withMutations(function(r){A.default.dispatchStart(t,e,n),t.get("stores").forEach(function(o,u){var a=r.get(u),s=void 0;try{s=o.handle(a,e,n)}catch(e){throw A.default.dispatchError(t,e.message),e}if(void 0===s&&f(t,"throwOnUndefinedStoreReturnValue")){var c="Store handler must return a value, did you forget a return statement";throw A.default.dispatchError(t,c),new Error(c)}r.set(u,s),a!==s&&(i=i.add(u))}),A.default.dispatchEnd(t,r,i)}),u=t.set("state",o).set("dirtyStores",i).update("storeStates",function(t){return b(t,i)});return I(u)}function s(t,e){var n=[],r=(0,D.toImmutable)({}).withMutations(function(r){(0,R.each)(e,function(e,i){var o=t.getIn(["stores",i]);if(o){var u=o.deserialize(e);void 0!==u&&(r.set(i,u),n.push(i))}})}),i=w.default.Set(n);return t.update("state",function(t){return t.merge(r)}).update("dirtyStores",function(t){return t.union(i)}).update("storeStates",function(t){return b(t,n)})}function c(t,e,n){var r=e;(0,z.isKeyPath)(e)&&(e=(0,C.fromKeyPath)(e));var i=t.get("nextId"),o=(0,C.getStoreDeps)(e),u=w.default.Map({id:i,storeDeps:o,getterKey:r,getter:e,handler:n}),a=void 0;return a=0===o.size?t.update("any",function(t){return t.add(i)}):t.withMutations(function(t){o.forEach(function(e){var n=["stores",e];t.hasIn(n)||t.setIn(n,w.default.Set()),t.updateIn(["stores",e],function(t){return t.add(i)})})}),a=a.set("nextId",i+1).setIn(["observersMap",i],u),{observerState:a,entry:u}}function f(t,e){var n=t.getIn(["options",e]);if(void 0===n)throw new Error("Invalid option: "+e);return n}function h(t,e,n){var r=t.get("observersMap").filter(function(t){var r=t.get("getterKey"),i=!n||t.get("handler")===n;return!!i&&((0,z.isKeyPath)(e)&&(0,z.isKeyPath)(r)?(0,z.isEqual)(e,r):e===r)});return t.withMutations(function(t){r.forEach(function(e){return l(t,e)})})}function l(t,e){return t.withMutations(function(t){var n=e.get("id"),r=e.get("storeDeps");0===r.size?t.update("any",function(t){return t.remove(n)}):r.forEach(function(e){t.updateIn(["stores",e],function(t){return t?t.remove(n):t})}),t.removeIn(["observersMap",n])})}function p(t){var e=t.get("state");return t.withMutations(function(t){var n=t.get("stores"),r=n.keySeq().toJS();n.forEach(function(n,r){var i=e.get(r),o=n.handleReset(i);if(void 0===o&&f(t,"throwOnUndefinedStoreReturnValue"))throw new Error("Store handleReset() must return a value, did you forget a return statement");if(f(t,"throwOnNonImmutableStore")&&!(0,D.isImmutableValue)(o))throw new Error("Store reset state must be an immutable value, did you forget to call toImmutable");t.setIn(["state",r],o)}),t.update("storeStates",function(t){return b(t,r)}),v(t)})}function _(t,e){var n=t.get("state");if((0,z.isKeyPath)(e))return i(n.getIn(e),t);if(!(0,C.isGetter)(e))throw new Error("evaluate must be passed a keyPath or Getter");if(m(t,e))return i(E(t,e),t);var r=(0,C.getDeps)(e).map(function(e){return _(t,e).result}),o=(0,C.getComputeFn)(e).apply(null,r);return i(o,g(t,e,o))}function d(t){var e={};return t.get("stores").forEach(function(n,r){var i=t.getIn(["state",r]),o=n.serialize(i);void 0!==o&&(e[r]=o)}),e}function v(t){return t.set("dirtyStores",w.default.Set())}function y(t){return t}function S(t,e){var n=y(e);return t.getIn(["cache",n])}function m(t,e){var n=S(t,e);if(!n)return!1;var r=n.get("storeStates");return 0!==r.size&&r.every(function(e,n){return t.getIn(["storeStates",n])===e})}function g(t,e,n){var r=y(e),i=t.get("dispatchId"),o=(0,C.getStoreDeps)(e),u=(0,D.toImmutable)({}).withMutations(function(e){o.forEach(function(n){var r=t.getIn(["storeStates",n]);e.set(n,r)})});return t.setIn(["cache",r],w.default.Map({value:n,storeStates:u,dispatchId:i}))}function E(t,e){var n=y(e);return t.getIn(["cache",n,"value"])}function I(t){return t.update("dispatchId",function(t){return t+1})}function b(t,e){return t.withMutations(function(t){e.forEach(function(e){var n=t.has(e)?t.get(e)+1:1;t.set(e,n)})})}Object.defineProperty(e,"__esModule",{value:!0}),e.registerStores=o,e.replaceStores=u,e.dispatch=a,e.loadState=s,e.addObserver=c,e.getOption=f,e.removeObserver=h,e.removeObserverByEntry=l,e.reset=p,e.evaluate=_,e.serialize=d,e.resetDirtyStores=v;var O=n(3),w=r(O),T=n(9),A=r(T),D=n(5),C=n(10),z=n(11),R=n(4),M=w.default.Record({result:null,reactorState:null})},function(t,e,n){var r=n(8);e.dispatchStart=function(t,e,n){(0,r.getOption)(t,"logDispatches")&&console.group&&(console.groupCollapsed("Dispatch: %s",e),console.group("payload"),console.debug(n),console.groupEnd())},e.dispatchError=function(t,e){(0,r.getOption)(t,"logDispatches")&&console.group&&(console.debug("Dispatch error: "+e),console.groupEnd())},e.dispatchEnd=function(t,e,n){(0,r.getOption)(t,"logDispatches")&&console.group&&((0,r.getOption)(t,"logDirtyStores")&&console.log("Stores updated:",n.toList().toJS()),(0,r.getOption)(t,"logAppState")&&console.debug("Dispatch done, new state: ",e.toJS()),console.groupEnd())}},function(t,e,n){function r(t){return t&&t.__esModule?t:{default:t}}function i(t){return(0,l.isArray)(t)&&(0,l.isFunction)(t[t.length-1])}function o(t){return t[t.length-1]}function u(t){return t.slice(0,t.length-1)}function a(t,e){e||(e=h.default.Set());var n=h.default.Set().withMutations(function(e){if(!i(t))throw new Error("getFlattenedDeps must be passed a Getter");u(t).forEach(function(t){if((0,p.isKeyPath)(t))e.add((0,f.List)(t));else{if(!i(t))throw new Error("Invalid getter, each dependency must be a KeyPath or Getter");e.union(a(t))}})});return e.union(n)}function s(t){if(!(0,p.isKeyPath)(t))throw new Error("Cannot create Getter from KeyPath: "+t);return[t,_]}function c(t){if(t.hasOwnProperty("__storeDeps"))return t.__storeDeps;var e=a(t).map(function(t){return t.first()}).filter(function(t){return!!t});return Object.defineProperty(t,"__storeDeps",{enumerable:!1,configurable:!1,writable:!1,value:e}),e}Object.defineProperty(e,"__esModule",{value:!0});var f=n(3),h=r(f),l=n(4),p=n(11),_=function(t){return t};e.default={isGetter:i,getComputeFn:o,getFlattenedDeps:a,getStoreDeps:c,getDeps:u,fromKeyPath:s},t.exports=e.default},function(t,e,n){function r(t){return t&&t.__esModule?t:{default:t}}function i(t){return(0,s.isArray)(t)&&!(0,s.isFunction)(t[t.length-1])}function o(t,e){var n=a.default.List(t),r=a.default.List(e);return a.default.is(n,r)}Object.defineProperty(e,"__esModule",{value:!0}),e.isKeyPath=i,e.isEqual=o;var u=n(3),a=r(u),s=n(4)},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=(0,r.Map)({logDispatches:!1,logAppState:!1,logDirtyStores:!1,throwOnUndefinedActionType:!1,throwOnUndefinedStoreReturnValue:!1,throwOnNonImmutableStore:!1,throwOnDispatchInDispatch:!1});e.PROD_OPTIONS=i;var o=(0,r.Map)({logDispatches:!0,logAppState:!0,logDirtyStores:!0,throwOnUndefinedActionType:!0,throwOnUndefinedStoreReturnValue:!0,throwOnNonImmutableStore:!0,throwOnDispatchInDispatch:!0});e.DEBUG_OPTIONS=o;var u=(0,r.Record)({dispatchId:0,state:(0,r.Map)(),stores:(0,r.Map)(),cache:(0,r.Map)(),storeStates:(0,r.Map)(),dirtyStores:(0,r.Set)(),debug:!1,options:i});e.ReactorState=u;var a=(0,r.Record)({any:(0,r.Set)(),stores:(0,r.Map)({}),observersMap:(0,r.Map)({}),nextId:1});e.ObserverState=a}])})}),Ie=Ee&&"object"==typeof Ee&&"default"in Ee?Ee.default:Ee,be=t(function(t){var e=function(t){var e,n={};if(!(t instanceof Object)||Array.isArray(t))throw new Error("keyMirror(...): Argument must be an object.");for(e in t)t.hasOwnProperty(e)&&(n[e]=e);return n};t.exports=e}),Oe=be&&"object"==typeof be&&"default"in be?be.default:be,we=Oe({VALIDATING_AUTH_TOKEN:null,VALID_AUTH_TOKEN:null,INVALID_AUTH_TOKEN:null,LOG_OUT:null}),Te=Ie.Store,Ae=Ie.toImmutable,De=new Te({getInitialState:function(){return Ae({isValidating:!1,authToken:!1,host:null,isInvalid:!1,errorMessage:""})},initialize:function(){this.on(we.VALIDATING_AUTH_TOKEN,e),this.on(we.VALID_AUTH_TOKEN,n),this.on(we.INVALID_AUTH_TOKEN,r)}}),Ce=Ie.Store,ze=Ie.toImmutable,Re=new Ce({getInitialState:function(){return ze({authToken:null,host:""})},initialize:function(){this.on(we.VALID_AUTH_TOKEN,i),this.on(we.LOG_OUT,o)}}),Me=Ie.Store,Le=new Me({getInitialState:function(){return!0},initialize:function(){this.on(we.VALID_AUTH_TOKEN,u)}}),je=Oe({STREAM_START:null,STREAM_STOP:null,STREAM_ERROR:null}),Ne="object"==typeof window&&"EventSource"in window,ke=Ie.Store,Ue=Ie.toImmutable,Pe=new ke({getInitialState:function(){return Ue({isSupported:Ne,isStreaming:!1,useStreaming:!0,hasError:!1})},initialize:function(){this.on(je.STREAM_START,a),this.on(je.STREAM_STOP,s),this.on(je.STREAM_ERROR,c),this.on(je.LOG_OUT,f)}}),He=Oe({API_FETCH_ALL_START:null,API_FETCH_ALL_SUCCESS:null,API_FETCH_ALL_FAIL:null,SYNC_SCHEDULED:null,SYNC_SCHEDULE_CANCELLED:null}),xe=Ie.Store,Ve=new xe({getInitialState:function(){return!0},initialize:function(){this.on(He.API_FETCH_ALL_START,function(){return!0}),this.on(He.API_FETCH_ALL_SUCCESS,function(){return!1}),this.on(He.API_FETCH_ALL_FAIL,function(){return!1}),this.on(He.LOG_OUT,function(){return!1})}}),qe=Ie.Store,Fe=new qe({getInitialState:function(){return!1},initialize:function(){this.on(He.SYNC_SCHEDULED,function(){return!0}),this.on(He.SYNC_SCHEDULE_CANCELLED,function(){return!1}),this.on(He.LOG_OUT,function(){return!1})}}),Ge=Oe({API_FETCH_SUCCESS:null,API_FETCH_START:null,API_FETCH_FAIL:null,API_SAVE_SUCCESS:null,API_SAVE_START:null,API_SAVE_FAIL:null,API_DELETE_SUCCESS:null,API_DELETE_START:null,API_DELETE_FAIL:null,LOG_OUT:null}),Ke=Ie.Store,Ye=Ie.toImmutable,Be=new Ke({getInitialState:function(){return Ye({})},initialize:function(){var t=this;this.on(Ge.API_FETCH_SUCCESS,h),this.on(Ge.API_SAVE_SUCCESS,h),this.on(Ge.API_DELETE_SUCCESS,l),this.on(Ge.LOG_OUT,function(){return t.getInitialState()})}}),Je=t(function(t){function e(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function n(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=n()?Object.assign:function(t,n){for(var o,u,a=arguments,s=e(t),c=1;c \ No newline at end of file diff --git a/source/demo/frontend.html b/source/demo/frontend.html index 95ae493cabb..ca813ce680a 100644 --- a/source/demo/frontend.html +++ b/source/demo/frontend.html @@ -1,10 +1,5 @@ - \ No newline at end of file +t},updateStyles:function(e){e&&this.mixin(this.customStyle,e),i?t.updateNativeStyleProperties(this,this.customStyle):(this.isAttached?this._needsStyleProperties()?this._updateStyleProperties():this._styleProperties=null:this.__stylePropertiesInvalid=!0,this._styleCache&&this._styleCache.clear(),this._updateRootStyles())},_updateRootStyles:function(e){e=e||this.root;for(var t,n=Polymer.dom(e)._query(function(e){return e.shadyRoot||e.shadowRoot}),r=0,s=n.length;r0&&l.push(t);return[{removed:a,added:l}]}},Polymer.Collection.get=function(e){return Polymer._collections.get(e)||new Polymer.Collection(e)},Polymer.Collection.applySplices=function(e,t){var n=Polymer._collections.get(e);return n?n._applySplices(t):null},Polymer({is:"dom-repeat",extends:"template",_template:null,properties:{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},sort:{type:Function,observer:"_sortChanged"},filter:{type:Function,observer:"_filterChanged"},observe:{type:String,observer:"_observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!0,readOnly:!0},initialCount:{type:Number,observer:"_initializeChunking"},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"_computeFrameTime(targetFramerate)"}},behaviors:[Polymer.Templatizer],observers:["_itemsChanged(items.*)"],created:function(){this._instances=[],this._pool=[],this._limit=1/0;var e=this;this._boundRenderChunk=function(){e._renderChunk()}},detached:function(){this.__isDetached=!0;for(var e=0;e=0;t--){var n=this._instances[t];n.isPlaceholder&&t=this._limit&&(n=this._downgradeInstance(t,n.__key__)),e[n.__key__]=t,n.isPlaceholder||n.__setProperty(this.indexAs,t,!0)}this._pool.length=0,this._setRenderedItemCount(this._instances.length),this.fire("dom-change"),this._tryRenderChunk()},_applyFullRefresh:function(){var e,t=this.collection;if(this._sortFn)e=t?t.getKeys():[];else{e=[];var n=this.items;if(n)for(var r=0;r=r;a--)this._detachAndRemoveInstance(a)},_numericSort:function(e,t){return e-t},_applySplicesUserSort:function(e){for(var t,n,r=this.collection,s={},i=0;i=0;i--){var h=a[i];void 0!==h&&this._detachAndRemoveInstance(h)}var c=this;if(l.length){this._filterFn&&(l=l.filter(function(e){return c._filterFn(r.getItem(e))})),l.sort(function(e,t){return c._sortFn(r.getItem(e),r.getItem(t))});var u=0;for(i=0;i>1,a=this._instances[o].__key__,l=this._sortFn(n.getItem(a),r);if(l<0)e=o+1;else{if(!(l>0)){i=o;break}s=o-1}}return i<0&&(i=s+1),this._insertPlaceholder(i,t),i},_applySplicesArrayOrder:function(e){for(var t,n=0;n=0?(e=this.as+"."+e.substring(n+1),i._notifyPath(e,t,!0)):i.__setProperty(this.as,t,!0))}},itemForElement:function(e){var t=this.modelForElement(e);return t&&t[this.as]},keyForElement:function(e){var t=this.modelForElement(e);return t&&t.__key__},indexForElement:function(e){var t=this.modelForElement(e);return t&&t[this.indexAs]}}),Polymer({is:"array-selector",_template:null,properties:{items:{type:Array,observer:"clearSelection"},multi:{type:Boolean,value:!1,observer:"clearSelection"},selected:{type:Object,notify:!0},selectedItem:{type:Object,notify:!0},toggle:{type:Boolean,value:!1}},clearSelection:function(){if(Array.isArray(this.selected))for(var e=0;e \ No newline at end of file diff --git a/source/demo/index.html b/source/demo/index.html index 4181b10bd79..e80d0d72e50 100644 --- a/source/demo/index.html +++ b/source/demo/index.html @@ -16,6 +16,13 @@ user-scalable=no' /> \ No newline at end of file diff --git a/source/demo/panels/ha-panel-dev-info.html b/source/demo/panels/ha-panel-dev-info.html new file mode 100644 index 00000000000..e255ca2f83d --- /dev/null +++ b/source/demo/panels/ha-panel-dev-info.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/source/demo/panels/ha-panel-dev-service.html b/source/demo/panels/ha-panel-dev-service.html new file mode 100644 index 00000000000..d1ef9154fb2 --- /dev/null +++ b/source/demo/panels/ha-panel-dev-service.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/demo/panels/ha-panel-dev-state.html b/source/demo/panels/ha-panel-dev-state.html new file mode 100644 index 00000000000..f539185bb87 --- /dev/null +++ b/source/demo/panels/ha-panel-dev-state.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/demo/panels/ha-panel-dev-template.html b/source/demo/panels/ha-panel-dev-template.html new file mode 100644 index 00000000000..22e214a7591 --- /dev/null +++ b/source/demo/panels/ha-panel-dev-template.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/source/demo/panels/ha-panel-history.html b/source/demo/panels/ha-panel-history.html new file mode 100644 index 00000000000..95bfe398184 --- /dev/null +++ b/source/demo/panels/ha-panel-history.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/source/demo/panels/ha-panel-iframe.html b/source/demo/panels/ha-panel-iframe.html new file mode 100644 index 00000000000..ff2cdbfe4b4 --- /dev/null +++ b/source/demo/panels/ha-panel-iframe.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/demo/panels/ha-panel-logbook.html b/source/demo/panels/ha-panel-logbook.html new file mode 100644 index 00000000000..c8afdcaecdb --- /dev/null +++ b/source/demo/panels/ha-panel-logbook.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/source/demo/partial-map.html b/source/demo/panels/ha-panel-map.html similarity index 77% rename from source/demo/partial-map.html rename to source/demo/panels/ha-panel-map.html index 0d3aaf12076..44d8b26ab93 100644 --- a/source/demo/partial-map.html +++ b/source/demo/panels/ha-panel-map.html @@ -1,4 +1,4 @@ - \ No newline at end of file +case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,i,n,s){var a="_leaflet_",r=this._pointers,h=function(t){"mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&o.DomEvent.preventDefault(t);for(var e=!1,i=0;i1))&&(this._moved||(o.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),o.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta,!1,!0)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return void(this._zooming=!1);var t=this._map;this._zooming=!1,o.DomUtil.removeClass(t._mapPane,"leaflet-touching"),o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),n=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._moved=!1},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(t){return this._moved=!1,!(!t.shiftKey||1!==t.which&&1!==t.button)&&(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),void o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this))},_onMouseMove:function(t){this._moved||(this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),this._moved=!0,i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),o.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),o.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(t){this._marker.fire("moveend").fire("dragend",t)}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a).on(r,"click",this._refocusOnMap,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange,this).off("layerremove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):o.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),o.DomEvent.on(i,"click",function(){setTimeout(o.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,void this.fire("step")):void this._onTransitionEnd()},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,(!0))},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=e===i?this._zoom:this._limitZoom(e),t=this._limitCenter(o.latLng(t),e,this.options.maxBounds),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return!((e&&e.animate)!==!0&&!this.getSize().contains(i))&&(this.panBy(i,e),!0)}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return!(i.animate!==!0&&!this.getSize().contains(o))&&(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0)},_animateZoom:function(t,e,i,n,s,a,r){r||(this._animatingZoom=!0),o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),o.Util.requestAnimFrame(function(){this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a}),setTimeout(o.bind(this._onZoomTransitionEnd,this),250)},this)},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),o.Util.requestAnimFrame(function(){this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)},this))}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth);var i=this._map.getZoom();(i>this.options.maxZoom||i.5&&.5>n?(t.style.visibility="hidden",void this._stopLoadingImages(t)):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),void clearTimeout(this._clearBgBufferTimer))},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r,timestamp:t.timestamp};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document)- \ No newline at end of file diff --git a/source/developers/credits.markdown b/source/developers/credits.markdown index addd15d772c..c759e037389 100644 --- a/source/developers/credits.markdown +++ b/source/developers/credits.markdown @@ -78,10 +78,11 @@ This page contains a list of people who have contributed in one way or another t - [Florian Holzapfel](https://github.com/florianholzapfel) - [fotoetienne](https://github.com/fotoetienne) - [Fredrik Haglund](https://github.com/PetitCircuitLab) +- [Fredrik Lindqvist](https://github.com/Landrash) - [GadgetReactor](https://github.com/GadgetReactor) - [Geoff Norton](https://github.com/kangaroo) - [goir](https://github.com/goir) -- [gottsman](https://github.com/gottsman) +- [Kevin Gottsman](https://github.com/gottsman) - [Greg Dowling](https://github.com/pavoni) - [Guillem Barba](https://github.com/gbarba) - [Gustav Ahlberg](https://github.com/Gyran) @@ -97,6 +98,7 @@ This page contains a list of people who have contributed in one way or another t - [Ian Copp](https://github.com/icopp) - [Igor Shults](https://github.com/ishults) - [Issac Kelly](https://github.com/issackelly) +- [Jacob Tomlinson](https://github.com/jacobtomlinson) - [James Cole](https://github.com/jamespcole) - [Jan Harkes](https://github.com/jaharkes) - [Jan-Preben Mossin](https://github.com/jpmossin) diff --git a/source/developers/development_validation.markdown b/source/developers/development_validation.markdown new file mode 100644 index 00000000000..97284748809 --- /dev/null +++ b/source/developers/development_validation.markdown @@ -0,0 +1,67 @@ +--- +layout: page +title: "Validate the input" +description: "Validation of entries in configuration.yaml" +date: 2016-08-11 20:00 +sidebar: true +comments: false +sharing: true +footer: true +--- + +The `configuration.yaml` file contains the configuration options for components and platforms. To ensure that the given configuration provided by the user is valid we use [voluptuous](https://pypi.python.org/pypi/voluptuous) to check it. Certain entries are optional or could be required for the setup of a platform or a component. Others must be of a certain type or out of an already defined list. This will ensure that the users are notified if something is wrong with a platform or component setup before Home Assistant is running. + +Beside the [voluptuous](https://pypi.python.org/pypi/voluptuous) default types are a bunch of custom types available. To get a full overview take a look at the [config_validation.py](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/helpers/config_validation.py) helper. + +- Types: `string`, `byte`, and `boolean` +- Entity ID: `entity_id` and `entity_ids` +- Numbers: `small_float` and `positive_int` +- Time: `time`, `time_zone` +- Misc: `template`, `slug`, `temperature_unit`, `latitude`, `longitude`, `isfile`, `sun_event`, `ensure_list`, and `icon` + +To validate plaforms using [MQTT](/components/mqtt/) there are `valid_subscribe_topic` and `valid_publish_topic` present. + +### {% linkable_title Snippets %} + +This section contains a couple of snippets for the validation we use. + +### {% linkable_title Default name %} + +```python +DEFAULT_NAME = 'Sensor name' + +PLATFORM_SCHEMA = vol.Schema({ + ... + vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, +``` + +### {% linkable_title Port %} + +As all port numbers are coming out of the range 1 till 65535 a range check should be performed. + +```python +DEFAULT_PORT = 993 + +PLATFORM_SCHEMA = vol.Schema({ + [...] + vol.Optional(CONF_PORT, default=DEFAULT_PORT): + vol.All(vol.Coerce(int), vol.Range(min=1, max=65535)), +``` + +### {% linkable_title Sensor types %} + +If a sensor has a pre-defined list of available options it should be tested if the configuration entry matches it. + +```python +SENSOR_TYPES = { + 'article_cache': ('Article Cache', 'MB'), + 'average_download_rate': ('Average Speed', 'MB/s'), +} + +PLATFORM_SCHEMA = vol.Schema({ + .... + vol.Optional(CONF_MONITORED_VARIABLES, default=[]): + [vol.In(SENSOR_TYPES)], +``` + + diff --git a/source/developers/platform_example_sensor.markdown b/source/developers/platform_example_sensor.markdown index 8902faead2d..2fd29db8faa 100644 --- a/source/developers/platform_example_sensor.markdown +++ b/source/developers/platform_example_sensor.markdown @@ -45,7 +45,7 @@ class ExampleSensor(Entity): @property def state(self): - """Return the state of the sensor."" + """Return the state of the sensor.""" return 23 @property diff --git a/source/getting-started/automation-condition.markdown b/source/getting-started/automation-condition.markdown index 89c18d3b271..a28b3c93a0f 100644 --- a/source/getting-started/automation-condition.markdown +++ b/source/getting-started/automation-condition.markdown @@ -29,8 +29,8 @@ Example of using condition: entity_id: sensor.mini_despacho to: 'ON' condition: - condition: or - conditions: + condition: or + conditions: - condition: template value_template: '{{ states.sun.sun.attributes.elevation < 4 }}' - condition: template diff --git a/source/getting-started/automation-templating.markdown b/source/getting-started/automation-templating.markdown index b4e0e7922a5..d7957e61e24 100644 --- a/source/getting-started/automation-templating.markdown +++ b/source/getting-started/automation-templating.markdown @@ -59,15 +59,15 @@ The following tables show the available trigger data per platform. | `trigger.entity_id` | Entity ID that we observe. | `trigger.below` | The below threshold, if any. | `trigger.above` | The above threshold, if any. -| `trigger.from_state` | The previous state of the entity. -| `trigger.to_state` | The new state that triggered trigger. +| `trigger.from_state` | The previous [state object] of the entity. +| `trigger.to_state` | The new [state object] that triggered trigger. | Template variable | Data | | ---- | ---- | | `trigger.platform` | Hardcoded: `state` | `trigger.entity_id` | Entity ID that we observe. -| `trigger.from_state` | The previous state of the entity. -| `trigger.to_state` | The new state that triggered trigger. +| `trigger.from_state` | The previous [state object] of the entity. +| `trigger.to_state` | The new [state object] that triggered trigger. | `trigger.for` | Timedelta object how long state has been to state, if any. | Template variable | Data | @@ -80,8 +80,8 @@ The following tables show the available trigger data per platform. | ---- | ---- | | `trigger.platform` | Hardcoded: `template` | `trigger.entity_id` | Entity ID that caused change. -| `trigger.from_state` | Previous state of entity that caused change. -| `trigger.to_state` | New state of entity that caused template to change. +| `trigger.from_state` | Previous [state object] of entity that caused change. +| `trigger.to_state` | New [state object] of entity that caused template to change. | Template variable | Data | | ---- | ---- | @@ -92,7 +92,9 @@ The following tables show the available trigger data per platform. | ---- | ---- | | `trigger.platform` | Hardcoded: `zone` | `trigger.entity_id` | Entity ID that we are observing. -| `trigger.from_state` | Previous state of the entity. -| `trigger.to_state` | New state of the entity. +| `trigger.from_state` | Previous [state object] of the entity. +| `trigger.to_state` | New [state object] of the entity. | `trigger.zone` | State object of zone | `trigger.event` | Event that trigger observed: `enter` or `leave`. + +[state object]: /topics/state_object/ diff --git a/source/getting-started/autostart-macos.markdown b/source/getting-started/autostart-macos.markdown index 09ae93e25ad..c61bf57331d 100644 --- a/source/getting-started/autostart-macos.markdown +++ b/source/getting-started/autostart-macos.markdown @@ -15,7 +15,7 @@ To get Home Assistant installed as a background service, run: ```bash -$ hass --install-osx +$ hass --script macos install Home Assistant has been installed. Open it here: http://localhost:8123 ``` @@ -25,7 +25,7 @@ Home Assistant will log to `~/Library/Logs/homeassistant.log` To uninstall the service, run: ```bash -$ hass --uninstall-osx +$ hass --script macos uninstall Home Assistant has been uninstalled. ``` diff --git a/source/getting-started/autostart-systemd.markdown b/source/getting-started/autostart-systemd.markdown index bb3a21f36d1..f3e90be5959 100644 --- a/source/getting-started/autostart-systemd.markdown +++ b/source/getting-started/autostart-systemd.markdown @@ -20,7 +20,7 @@ If the preceding command returns the string `systemd`, you are likely using `sys If you want Home Assistant to be launched automatically, an extra step is needed to setup `systemd`. You need a service file to control Home Assistant with `systemd`. If you are using a Raspberry Pi with Raspbian then replace the `[your user]` with `pi` otherwise use your user you want to run Home Assistant. `ExecStart` contains the path to `hass` and this may vary. Check with `whereis hass` for the location. ```bash -$ su -c 'cat <> /lib/systemd/system/home-assistant@[your user].service +$ su -c 'cat <> /etc/systemd/system/home-assistant@[your user].service [Unit] Description=Home Assistant After=network.target @@ -38,7 +38,7 @@ EOF' There is also another [sample service file](https://raw.githubusercontent.com/home-assistant/home-assistant/master/script/home-assistant%40.service) available. To use this one, just download it. ```bash -$ sudo wget https://raw.githubusercontent.com/home-assistant/home-assistant/master/script/home-assistant%40.service -O /lib/systemd/system/home-assistant@[your user].service +$ sudo wget https://raw.githubusercontent.com/home-assistant/home-assistant/master/script/home-assistant%40.service -O /etc/systemd/system/home-assistant@[your user].service ``` You need to reload `systemd` to make the daemon aware of the new configuration. Enable and launch Home Assistant after that. @@ -54,7 +54,7 @@ If everything went well, `sudo systemctl start home-assistant@[your user]` shoul ```bash $ sudo systemctl status home-assistant@[your user] -l ● home-assistant@fab.service - Home Assistant for [your user] - Loaded: loaded (/usr/lib/systemd/system/home-assistant@[your user].service; enabled; vendor preset: disabled) + Loaded: loaded (/etc/systemd/system/home-assistant@[your user].service; enabled; vendor preset: disabled) Active: active (running) since Sat 2016-03-26 12:26:06 CET; 13min ago Main PID: 30422 (hass) CGroup: /system.slice/system-home\x2dassistant.slice/home-assistant@[your user].service @@ -66,5 +66,10 @@ $ sudo systemctl status home-assistant@[your user] -l To get Home Assistant's logging output, simple use `journalctl`. ```bash -$ sudo journalctl -f -u home-assistant@[your user] +$ journalctl -f -u home-assistant@[your user] +``` + +Because the log can scroll quite quickly, you might want to open a second terminal to view only the errors: +```bash +$ journalctl -f -u home-assistant@[your user] | grep -i 'error' ``` diff --git a/source/getting-started/installation-docker.markdown b/source/getting-started/installation-docker.markdown index be7924d49cd..198b214eec4 100644 --- a/source/getting-started/installation-docker.markdown +++ b/source/getting-started/installation-docker.markdown @@ -21,6 +21,12 @@ This will launch Home Assistant and serve the web interface from port 8123 on yo When using boot2docker on OS X you are unable to map the local time to your Docker container. Replace `-v /etc/localtime:/etc/localtime:ro` with `-e "TZ=America/Los_Angeles"` (replacing America/Los_Angeles with [your timezone](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones))

    +If you change the config you have to restart the server. +To do that you have 2 options. + + 1. You can go to the service developer tool icon service developer tools, select the service `homeassistant/restart` and click "Call Service". + 2. Or you can restart it from an terminal by running `docker restart home-assistant` + ### {% linkable_title Troubleshooting %} If you run into any issues, please see [the troubleshooting page](/getting-started/troubleshooting/). It contains solutions to many of the more commonly encountered issues. diff --git a/source/getting-started/installation-raspberry-pi-all-in-one.markdown b/source/getting-started/installation-raspberry-pi-all-in-one.markdown index b52a179c895..96d26fb4b67 100644 --- a/source/getting-started/installation-raspberry-pi-all-in-one.markdown +++ b/source/getting-started/installation-raspberry-pi-all-in-one.markdown @@ -9,7 +9,7 @@ footer: true The [Raspberry Pi All-In-One Installer](https://github.com/home-assistant/fabric-home-assistant) deploys a complete Home Assistant server including support for MQTT with websockets, Z-Wave, and the Open-Zwave Control Panel. -The only requirement is that you have a Raspberry Pi with a fresh installation of [Raspbian Jessie/Jessie Lite](https://www.raspberrypi.org/downloads/raspbian/) connected to your network. +The only requirement is that you have a Raspberry Pi with a fresh installation of [Raspbian Jessie](https://www.raspberrypi.org/downloads/raspbian/) connected to your network. * Login to Raspberry Pi. For example with `ssh pi@your_raspberry_pi_ip` * Run the following command @@ -73,6 +73,7 @@ After upgrading, you can restart Home Assistant a few different ways: To launch the OZWCP web application: +* Make sure Home Assistant is not running! So stop that first * Login to Raspberry Pi `ssh pi@your_raspberry_pi_ip` * Change to the ozwcp directory `cd /srv/hass/src/open-zwave-control-panel/` * Launch the control panel `sudo ./ozwcp -p 8888` diff --git a/source/getting-started/installation-vagrant.markdown b/source/getting-started/installation-vagrant.markdown index 1a1ee99cb10..f6fec2de2b9 100644 --- a/source/getting-started/installation-vagrant.markdown +++ b/source/getting-started/installation-vagrant.markdown @@ -9,7 +9,7 @@ sharing: true footer: true --- -A `Vagrantfile` is avalable into `virtualization/vagrant` folder for quickly spinning up a Linux virtual machine running Home Assistant. This can be beneficial for those who want to experiment with Home Assistant and/or developers willing to easily test local changes and run test suite against them. +A `Vagrantfile` is available into `virtualization/vagrant` folder for quickly spinning up a Linux virtual machine running Home Assistant. This can be beneficial for those who want to experiment with Home Assistant and/or developers willing to easily test local changes and run test suite against them.

    Vagrant is intended for testing/development only. It is NOT recommended for permanent installations. @@ -21,21 +21,29 @@ You must have [Vagrant](https://www.vagrantup.com/downloads.html) and [Virtualbo ## {% linkable_title Get Home Assistant source code %} -Download the home-assistant source code by either downloading the .zip file from [GitHub releases page](https://github.com/home-assistant/home-assistant/releases), or by using [Git](https://git-scm.com/) +Download the Home Assistant source code by either downloading the .zip file from [GitHub releases page](https://github.com/home-assistant/home-assistant/releases) or by using [Git](https://git-scm.com/) ```bash -git clone https://github.com/home-assistant/home-assistant.git -cd home-assistant/virtualization/vagrant +$ git clone https://github.com/home-assistant/home-assistant.git +$ cd home-assistant/virtualization/vagrant ```

    -The following instructions will assume you changed your working directory to be home-assistant/virtualization/vagrant. This is mandatory because Vagrant will look for informations about the running VM inside that folder and won't work otherwise +The following instructions will assume you changed your working directory to be `home-assistant/virtualization/vagrant`. This is mandatory because Vagrant will look for informations about the running VM inside that folder and won't work otherwise

    +

    +When using Vagrant on Windows, change git's `auto.crlf` to input before cloning the Home Assistant repository. With input setting git won't automatically change line endings from Unix LF to Windows CRLF. Shell scripts executed during provision won't work with Windows line endings. +

    + +```bash +$ git config --global core.autocrlf input +``` + ## {% linkable_title Create the Vagrant VM and start Home Assistant %} ```bash -vagrant up +$ vagrant up ``` This will download and start a virtual machine using Virtualbox, which will internally setup the development environment necessary to start Home Assistant process and run test suite as well. After the VM has started succesfully, the Home Assistant frontend will be accessible locally from your browser at [http://localhost:8123](http://localhost:8123) @@ -45,7 +53,7 @@ This will download and start a virtual machine using Virtualbox, which will inte To shutdown the Vagrant host: ```bash -vagrant halt +$ vagrant halt ``` To start it again, just run `vagrant up` @@ -57,7 +65,7 @@ The root `home-assistant` directory on your workstation will be mirrored with `/ Any changes made to the local directory on your workstation will be available from the Vagrant host, so to apply your changes to the Home Assistant process, just restart it: ```bash -touch restart ; vagrant provision +$ touch restart ; vagrant provision ``` ## {% linkable_title Run test suite (Tox) %} @@ -65,7 +73,7 @@ touch restart ; vagrant provision To run tests against your changes: ```bash -touch run_tests ; vagrant provision +$ touch run_tests ; vagrant provision ``` ## {% linkable_title Cleanup %} @@ -73,7 +81,7 @@ touch run_tests ; vagrant provision To completely remove the VM: ```bash -rm setup_done ; vagrant destroy -f +$ rm setup_done ; vagrant destroy -f ``` You can now recreate a completely new Vagrant host with `vagrant up` diff --git a/source/getting-started/scripts.markdown b/source/getting-started/scripts.markdown index af6bfa92504..54ae5a15bf0 100644 --- a/source/getting-started/scripts.markdown +++ b/source/getting-started/scripts.markdown @@ -72,7 +72,7 @@ delay: ```yaml # Waits however many minutes input_slider.minute_delay is set to # Valid formats include HH:MM and HH:MM:SS -delay: {% raw %}'00:{{ input_slider.minute_delay }}:00'{% endraw %} +delay: {% raw %}'00:{{ input_slider.minute_delay | int }}:00'{% endraw %} ``` #### {% linkable_title Fire an Event %} diff --git a/source/getting-started/troubleshooting.markdown b/source/getting-started/troubleshooting.markdown index f5d2b7c6d7c..c2d94b9b00f 100644 --- a/source/getting-started/troubleshooting.markdown +++ b/source/getting-started/troubleshooting.markdown @@ -29,7 +29,7 @@ $ python3 get-pip.py ``` #### {% linkable_title distutils.errors.DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both %} -This is a known issue if you're on a Mac using Homebrew to install Python. Please follow [these instructions](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md#note-on-pip-install---user) to resolve it. +This is a known issue if you're on a Mac using Homebrew to install Python. Please follow [these instructions](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Homebrew-and-Python.md#note-on-pip-install---user) to resolve it. #### {% linkable_title CentOS and Python 3 %} To run Python 3.x on [CentOS](https://www.centos.org/) or RHEL, [Software Collections](https://www.softwarecollections.org/en/scls/rhscl/rh-python34/) needs to be activated. diff --git a/source/getting-started/updating.markdown b/source/getting-started/updating.markdown index b67dbf4e2a3..c58dc458c8e 100644 --- a/source/getting-started/updating.markdown +++ b/source/getting-started/updating.markdown @@ -25,6 +25,8 @@ After updating, restart Home Assistant for the changes to take effect. This mean The upgrade needs to be run as the same user as the installation was done to avoid permission errors.

    +[BRUH automation](http://www.bruhautomation.com) has created [a tutorial video](https://www.youtube.com/watch?v=tuG2rs1Cl2Y) explaining how to upgrade Home Assistant. + #### {% linkable_title Run the development version %} If you want to stay on top of the development of Home Assistant then you can upgrade to the `dev` branch. diff --git a/source/getting-started/yaml.markdown b/source/getting-started/yaml.markdown index a814993b4bb..6e49d0973d0 100644 --- a/source/getting-started/yaml.markdown +++ b/source/getting-started/yaml.markdown @@ -29,6 +29,8 @@ The basics of YAML syntax are block collections and mappings containing key-valu Note that indentation is an important part of specifying relationships using YAML. Things that are indented are nested "inside" things that are one level higher. So in the above example, `platform: pushbullet` is a property of (nested inside) the `notify` component. Getting the right indentation can be tricky if you're not using an editor with a fixed width font. Tabs are not allowed to be used for indentation. Convention is to use 2 spaces for each level of indentation. +You can use [YAMLLint](http://www.yamllint.com/) to check if your YAML-syntax is correct before loading it into Home Assistant which will save you some time. +*Please pay attention on not putting in private data, as it is a 3rd-party website not maintained by Home Assistant.* Lines that start with **#** are comments and are ignored by the system. diff --git a/source/getting-started/z-wave-device-specific.markdown b/source/getting-started/z-wave-device-specific.markdown index df0d7363c00..1c04e451af3 100644 --- a/source/getting-started/z-wave-device-specific.markdown +++ b/source/getting-started/z-wave-device-specific.markdown @@ -9,76 +9,120 @@ sharing: true footer: true --- +##### {% linkable_title Motion or alarm sensors %} + +In order for Home Assistant to recognize well the sensor, you will need to change its configuration from `Basic Set (default)` to `Binary Sensor report` or `Alarm report`. Currently there's no way to do this in Home Assistant but you can use ozwcp (OpenZWave control panel), Domoticz or similar to do it +These devices will either show as a binary sensor or a sensor called `Alarm xxxx` and will report a numeric value. Test to see what value is what. Sometimes this is noted in the device manual. + + +##### {% linkable_title Locks and other secure devices %} + +These devices require a network key to be set for the zwave network before they are paired. This key is set in OpenZwave's `options.xml` which is located in Open Zwave's directory. This should also be the same directory as `config_path:` in your `configuration.yaml`. If it's not, make sure you have the same values in all the files you are using. +The option is commented out by default in `options.xml` and is a default key. Make your own unique key. The key is in Hexadecimals. +It is best to pair these devices in Open Zwave Control Panel or other Zwave tool that can show you logs while pairing. Test the device before you save the configuration. +Make sure you copy the newly saved `zwcfg_[home_id].xml`into your HomeAssistant config directory. + +##### {% linkable_title Event basic_level for automation %} +HomeAssistant will trigger a event when command_class_basic changes value on a node. +This can be virtually anything, so tests have to be made to determine what value equals what. +You can use this for automations. + +Example: + +```yaml + - alias: Minimote Button Pressed + trigger: + platform: event + event_type: zwave.node_event + event_data: + object_id: aeon_labs_minimote_1 + basic_level: 255 +``` + +##### {% linkable_title Event scene_id for automation %} +HomeAssistant will trigger a event when a scene is activated by a node in the zwave network. +This can be a press of a button, so tests have to be made to determine what scene_id equals what. +You can use this for automations. + +Example: + +```yaml + - alias: Minimote Button 1 Pressed + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 1 +``` + + ##### {% linkable_title Aeon Minimote %} Here's a handy configuration for the Aeon Labs Minimote that defines all possible button presses. Put it into `automation.yaml`. ```yaml -- alias: Minimote Button 1 Pressed - trigger: - platform: event - event_type: zwave.scene_activated - event_data: - entity_id: aeon_labs_minimote_1 - scene_id: 1 + - alias: Minimote Button 1 Pressed + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 1 -- alias: Minimote Button 1 Held - trigger: - platform: event - event_type: zwave.scene_activated - event_data: - entity_id: aeon_labs_minimote_1 - scene_id: 2 + - alias: Minimote Button 1 Held + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 2 -- alias: Minimote Button 2 Pressed - trigger: - platform: event - event_type: zwave.scene_activated - event_data: - entity_id: aeon_labs_minimote_1 - scene_id: 3 + - alias: Minimote Button 2 Pressed + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 3 -- alias: Minimote Button 2 Held - trigger: - platform: event - event_type: zwave.scene_activated - event_data: - entity_id: aeon_labs_minimote_1 - scene_id: 4 + - alias: Minimote Button 2 Held + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 4 -- alias: Minimote Button 3 Pressed - trigger: - platform: event - event_type: zwave.scene_activated - event_data: - entity_id: aeon_labs_minimote_1 - scene_id: 5 + - alias: Minimote Button 3 Pressed + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 5 -- alias: Minimote Button 3 Held - trigger: - platform: event - event_type: zwave.scene_activated - event_data: - entity_id: aeon_labs_minimote_1 - scene_id: 6 + - alias: Minimote Button 3 Held + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 6 -- alias: Minimote Button 4 Pressed - trigger: - platform: event - event_type: zwave.scene_activated - event_data: - entity_id: aeon_labs_minimote_1 - scene_id: 7 + - alias: Minimote Button 4 Pressed + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 7 -- alias: Minimote Button 4 Held - trigger: - platform: event - event_type: zwave.scene_activated - event_data: - entity_id: aeon_labs_minimote_1 - scene_id: 8 + - alias: Minimote Button 4 Held + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + object_id: aeon_labs_minimote_1 + scene_id: 8 ``` - -##### {% linkable_title Aeotec MultiSensor 6 %} - -In order for Home Assistant to recognize well the motion sensor, you will need to change its configuration from `Basic Set (default)` to `Binary Sensor report`. Currently there's no way to do this in Home Assistant but you can use ozwcp (OpenZWave control panel), Domoticz or similar to do it diff --git a/source/help/index.markdown b/source/help/index.markdown index b12aa1eeead..245ff6f6b14 100644 --- a/source/help/index.markdown +++ b/source/help/index.markdown @@ -15,7 +15,7 @@ There are various ways to get in touch with the Home Assistant community. It doe - [Forum](https://community.home-assistant.io/) - [Gitter Chatroom](https://gitter.im/home-assistant/home-assistant) for general Home Assistant discussions and questions. - - Follow us on [Twitter](https://twitter.com/home_assistant), use @home_assistant + - Follow us on [Twitter](https://twitter.com/home_assistant), use [@home_assistant](https://twitter.com/home_assistant) - Join the [Google+ community](https://plus.google.com/u/0/b/110560654828510104551/communities/106562234893511202708) - Join the [Reddit subreddit](https://reddit.com/r/homeassistant) in [/r/homeassistant](https://reddit.com/r/homeassistant) @@ -33,6 +33,7 @@ Have you found an issue in your Home Assistant installation? Please report it. R - [Home Assistant Support 101 - Getting around in Home Assistant](https://www.youtube.com/watch?v=dRfk9JAlPJk) ([Slides](https://docs.google.com/presentation/d/1PUnOpeFZxNj4LEjaohGqH_1hOGQGuS5yRHD1ThHr6nk/edit?usp=sharing)) - June 2016 - [Awaken your home: Python and the Internet of Things](https://www.youtube.com/watch?v=Cfasc9EgbMU&list=PLKsVm4cWHDQB9JBcD7_ZfNcvC6xx47QHT&index=1) at PyCon 2016 - June 2016 - [Automating your Home with Home Assistant](https://www.youtube.com/watch?v=4-6rTwKl6ww&list=PLKsVm4cWHDQB9JBcD7_ZfNcvC6xx47QHT&index=2) at OpenIoT 2016 - March 2016 +- [Automating Your Life - Home Automation](http://slides.com/teagan42/life_automation#/) at Develop Denver 2016 - August ### {% linkable_title Roadmap %} diff --git a/source/help/trivia.markdown b/source/help/trivia.markdown index 175b4269c58..9c7756c3f07 100644 --- a/source/help/trivia.markdown +++ b/source/help/trivia.markdown @@ -13,7 +13,7 @@ This page contains only irrelevant and unhelpful information about Home Assistan ### {% linkable_title Name %} -Unknown at the moment. +Isn't it obvious? Home Assistant is the good soul that is assisting you in your home. It's also common to refer to Home Assistant simply as HA or hass (not to be confused with the German word "Hass", it's more like the abbreviation of **H**ome **A**ssistant **S**erver **S**ervice). ### {% linkable_title Website %} @@ -33,7 +33,7 @@ This sections just contains some random numbers of the Home Assistant eco-system | Description | 2015 | |---|---| -| [Gitter.io](https://gitter.im/home-assistant/home-assistant) | 334 | +| [Gitter.io](https://gitter.im/home-assistant/home-assistant) | 334 | | [Forum posts](https://community.home-assistant.io/) | 352 | | [Forum topics](https://community.home-assistant.io/) | 83 | | [Forum members](https://community.home-assistant.io/) | 92 | diff --git a/source/images/blog/2016-07-laundry-automation/block-diagram.png b/source/images/blog/2016-07-laundry-automation/block-diagram.png new file mode 100644 index 00000000000..90c5956b647 Binary files /dev/null and b/source/images/blog/2016-07-laundry-automation/block-diagram.png differ diff --git a/source/images/blog/2016-07-laundry-automation/data-graph.png b/source/images/blog/2016-07-laundry-automation/data-graph.png new file mode 100644 index 00000000000..a34c0e4d232 Binary files /dev/null and b/source/images/blog/2016-07-laundry-automation/data-graph.png differ diff --git a/source/images/blog/2016-07-laundry-automation/protoboard.jpg b/source/images/blog/2016-07-laundry-automation/protoboard.jpg new file mode 100644 index 00000000000..fd29f778bd9 Binary files /dev/null and b/source/images/blog/2016-07-laundry-automation/protoboard.jpg differ diff --git a/source/images/blog/2016-07-laundry-automation/screenshot-ha.png b/source/images/blog/2016-07-laundry-automation/screenshot-ha.png new file mode 100644 index 00000000000..028706f1d4e Binary files /dev/null and b/source/images/blog/2016-07-laundry-automation/screenshot-ha.png differ diff --git a/source/images/blog/2016-08-optimizing-web-app/performance-diagram.png b/source/images/blog/2016-08-optimizing-web-app/performance-diagram.png new file mode 100644 index 00000000000..823bbb9d2c5 Binary files /dev/null and b/source/images/blog/2016-08-optimizing-web-app/performance-diagram.png differ diff --git a/source/images/blog/2016-08-optimizing-web-app/performance-timeline-0.18.2.png b/source/images/blog/2016-08-optimizing-web-app/performance-timeline-0.18.2.png new file mode 100644 index 00000000000..3ba88c93959 Binary files /dev/null and b/source/images/blog/2016-08-optimizing-web-app/performance-timeline-0.18.2.png differ diff --git a/source/images/blog/2016-08-optimizing-web-app/performance-timeline-0.26.png b/source/images/blog/2016-08-optimizing-web-app/performance-timeline-0.26.png new file mode 100644 index 00000000000..f961c550c1e Binary files /dev/null and b/source/images/blog/2016-08-optimizing-web-app/performance-timeline-0.26.png differ diff --git a/source/images/blog/2016-08-optimizing-web-app/timeline-corejs.png b/source/images/blog/2016-08-optimizing-web-app/timeline-corejs.png new file mode 100644 index 00000000000..b77584338d4 Binary files /dev/null and b/source/images/blog/2016-08-optimizing-web-app/timeline-corejs.png differ diff --git a/source/images/blog/2016-08-optimizing-web-app/timeline-no-more-es2015.png b/source/images/blog/2016-08-optimizing-web-app/timeline-no-more-es2015.png new file mode 100644 index 00000000000..a633d00751d Binary files /dev/null and b/source/images/blog/2016-08-optimizing-web-app/timeline-no-more-es2015.png differ diff --git a/source/images/supported_brands/nzbget.png b/source/images/supported_brands/nzbget.png new file mode 100644 index 00000000000..8f1166d559f Binary files /dev/null and b/source/images/supported_brands/nzbget.png differ diff --git a/source/index.html b/source/index.html index 3ad019e0157..0ee23f52baa 100644 --- a/source/index.html +++ b/source/index.html @@ -15,8 +15,8 @@ hide_github_edit: true