From 929b00df76d19f41f14ec62ac667201face14577 Mon Sep 17 00:00:00 2001 From: dcmartin Date: Fri, 13 Mar 2020 10:52:34 -0700 Subject: [PATCH] lgtm --- .../internet/binary_sensor/internet.yaml | 71 ------ homeassistant/internet/sensor/internet.yaml | 221 ------------------ homeassistant/motion/makefile | 1 + homeassistant/nmap/device_tracker | 1 + .../device_tracker.yaml.tmpl} | 0 5 files changed, 2 insertions(+), 292 deletions(-) delete mode 100644 homeassistant/internet/binary_sensor/internet.yaml delete mode 100644 homeassistant/internet/sensor/internet.yaml create mode 120000 homeassistant/nmap/device_tracker rename homeassistant/{device_tracker/nmap.yaml => nmap/device_tracker.yaml.tmpl} (100%) diff --git a/homeassistant/internet/binary_sensor/internet.yaml b/homeassistant/internet/binary_sensor/internet.yaml deleted file mode 100644 index 88f031a8f..000000000 --- a/homeassistant/internet/binary_sensor/internet.yaml +++ /dev/null @@ -1,71 +0,0 @@ -### -### INTERNET BINARY_SENSOR -### - -- platform: template - sensors: - internet_test: - entity_id: - - sensor.internet_test - - sensor.internet_test_ago - - input_number.internet_test_ago - value_template: > - {{ states('sensor.internet_test_ago')|int < states('input_number.internet_test_ago')|int }} - internet_slow: - entity_id: - - sensor.internet_test_receive - - sensor.internet_receive_statistics - - input_number.internet_deviation - value_template: >- - {% if states.sensor.internet_receive_statistics != none - and state_attr('sensor.internet_receive_statistics','standard_deviation') != none - and states.sensor.internet_receive_statistics.attributes.standard_deviation|float > 0 %} - {{ (((states.sensor.internet_receive_mean.state|float) - (states.sensor.internet_test_receive.state|float)) - / (states.sensor.internet_receive_statistics.attributes.standard_deviation|float) - > (states.input_number.internet_deviation.state|float)) }} - {%- else -%}null{%- endif -%} - icon_template: > - mdi:emoticon-sad - internet_slow_persistent: - entity_id: - - sensor.internet_test_receive - - sensor.internet_receive_stdev_mean - - input_number.internet_deviation - value_template: >- - {% if states.sensor.internet_receive_stdev_mean != none - and states.sensor.internet_receive_stdev_mean.state|float > 0 %} - {{ (((states.sensor.internet_receive_mean.state|float) - (states.sensor.internet_test_receive.state|float)) - / (states.sensor.internet_receive_stdev_mean.state|float) - > (states.input_number.internet_deviation.state|float)) }} - {%- else -%}null{%- endif -%} - icon_template: > - mdi:emoticon-sad - internet_fast: - entity_id: - - sensor.internet_test_receive - - sensor.internet_receive_statistics - - input_number.internet_deviation - value_template: >- - {% if states.sensor.internet_receive_statistics != none - and state_attr('sensor.internet_receive_statistics','standard_deviation') != none - and states.sensor.internet_receive_statistics.attributes.standard_deviation|float > 0 %} - {{ (((states.sensor.internet_test_receive.state|float) - (states.sensor.internet_receive_mean.state|float)) - / (states.sensor.internet_receive_statistics.attributes.standard_deviation|float)) - > (states.input_number.internet_deviation.state|float) }} - {%- else -%}null{%- endif -%} - icon_template: >- - mdi:emoticon-happy - internet_fast_persistent: - entity_id: - - sensor.internet_test_receive - - sensor.internet_receive_stdev_mean - - input_number.internet_deviation - value_template: >- - {% if states.sensor.internet_receive_stdev_mean != none - and states.sensor.internet_receive_stdev_mean.state|float > 0 %} - {{ (((states.sensor.internet_test_receive.state|float) - (states.sensor.internet_receive_mean.state|float)) - / (states.sensor.internet_receive_stdev_mean.state|float)) - > (states.input_number.internet_deviation.state|float) }} - {%- else -%}null{%- endif -%} - icon_template: >- - mdi:emoticon-happy diff --git a/homeassistant/internet/sensor/internet.yaml b/homeassistant/internet/sensor/internet.yaml deleted file mode 100644 index cce0ac058..000000000 --- a/homeassistant/internet/sensor/internet.yaml +++ /dev/null @@ -1,221 +0,0 @@ -### -## internet/sensor/internet.yaml -### - -- platform: command_line - command: speedtest --json | jq '.date='$(date +%s)'|.latitude=(.client.lat|tonumber)|.longitude=(.client.lon|tonumber)' - name: internet_test - scan_interval: !secret internet-scan-interval - command_timeout: 300 - json_attributes: - - server - - latitude - - longitude - - bytes_sent - - bytes_received - - client - - date - - timestamp - - ping - - download - - upload - value_template: > - {%- if value_json is defined -%}True{%- else -%}False{%- endif -%} - -- platform: template - sensors: - internet_test_date: - entity_id: - - sensor.internet_test - - sun.sun - unit_of_measurement: seconds - value_template: > - {% if states.sensor.internet_test.attributes != none and states.sensor.internet_test.attributes.date|int > 0 %} - {{ (now().timestamp()|int) - (states.sensor.internet_test.attributes.date|int) }} - {%- else -%}null{%- endif -%} - internet_counter: - entity_id: - - counter.internet_counter - unit_of_measurement: count - value_template: > - {% if states.counter.internet_counter is defined %} - {{ states.counter.internet_counter.state|int }} - {%- else -%}null{%- endif -%} - internet_slow_counter: - entity_id: - - counter.internet_slow_counter - unit_of_measurement: count - value_template: > - {% if states.counter.internet_slow_counter is defined %} - {{ states.counter.internet_slow_counter.state|int }} - {%- else -%}null{%- endif -%} - internet_fast_counter: - entity_id: - - counter.internet_fast_counter - unit_of_measurement: count - value_template: > - {% if states.counter.internet_fast_counter is defined %} - {{ states.counter.internet_fast_counter.state|int }} - {%- else -%}null{%- endif -%} - internet_test_ago: - entity_id: - - sensor.internet_test - - sun.sun - unit_of_measurement: seconds - value_template: > - {% if states.sensor.internet_test.attributes.date is defined %} - {{ (now().timestamp()|int) - (states.sensor.internet_test.attributes.date|int) }} - {%- else -%}null{%- endif -%} - internet_event_status: - entity_id: - - sensor.internet_test - value_template: >- - {% if states.sensor.internet_test is defined and states.sensor.internet_test.attributes.date is defined %} - From {{ states.sensor.internet_test.attributes.server.name }} at {{ states.sensor.internet_test.attributes.date | int | timestamp_custom("%a %b %d %I:%M %p") }} - {% else %} null {% endif %} - internet_test_receive: - entity_id: - - sensor.internet_test - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_test.attributes.download is defined and states.sensor.internet_test.attributes.download != null %} - {{ '%0.2f' | format(states.sensor.internet_test.attributes.download|float / 1000000.0) }} - {%- else -%}null{%- endif -%} - internet_test_send: - entity_id: - - sensor.internet_test - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_test.attributes.upload is defined and states.sensor.internet_test.attributes.upload != null %} - {{ '%0.2f' | format(states.sensor.internet_test.attributes.upload|float / 1000000.0) }} - {%- else -%}null{%- endif -%} - internet_receive_mean: - entity_id: - - sensor.internet_receive_statistics - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_receive_statistics is defined %} - {{ states.sensor.internet_receive_statistics.state }} - {%- else -%}null{%- endif -%} - internet_receive_min_value: - entity_id: - - sensor.internet_receive_statistics - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_receive_statistics is defined %} - {{ states.sensor.internet_receive_statistics.attributes.min_value }} - {%- else -%}null{%- endif -%} - internet_receive_max_value: - entity_id: - - sensor.internet_receive_statistics - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_receive_statistics is defined %} - {{ states.sensor.internet_receive_statistics.attributes.max_value }} - {%- else -%}null{%- endif -%} - internet_receive_stdev: - entity_id: - - sensor.internet_receive_statistics - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_receive_statistics is defined %} - {% if states.sensor.internet_receive_statistics.attributes.standard_deviation != 'unknown' %} - {{ states.sensor.internet_receive_statistics.attributes.standard_deviation }} - {%- else -%}null{%- endif -%} - {%- else -%}null{%- endif -%} - internet_send_mean: - entity_id: - - sensor.internet_send_statistics - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_send_statistics is defined %} - {{ states.sensor.internet_send_statistics.state }} - {%- else -%}null{%- endif -%} - internet_send_min_value: - entity_id: - - sensor.internet_send_statistics - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_send_statistics is defined %} - {{ states.sensor.internet_send_statistics.attributes.min_value }} - {%- else -%}null{%- endif -%} - internet_send_max_value: - entity_id: - - sensor.internet_send_statistics - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_send_statistics is defined %} - {{ states.sensor.internet_send_statistics.attributes.max_value }} - {%- else -%}null{%- endif -%} - internet_send_stdev: - entity_id: - - sensor.internet_send_statistics - unit_of_measurement: Mbps - value_template: > - {% if states.sensor.internet_send_statistics is defined %} - {% if states.sensor.internet_send_statistics.attributes.standard_deviation != 'unknown' %} - {{ states.sensor.internet_send_statistics.attributes.standard_deviation }} - {%- else -%}null{%- endif -%} - {%- else -%}null{%- endif -%} - internet_slow_count: - entity_id: - - sensor.internet_slow_count - unit_of_measurement: count - value_template: > - {% if states.sensor.internet_slow_count is defined %} - {{ states.sensor.internet_slow_count.state }} - {%- else -%}null{%- endif -%} - internet_fast_count: - entity_id: - - sensor.internet_fast_count - unit_of_measurement: count - value_template: > - {% if states.sensor.internet_fast_count is defined %} - {{ states.sensor.internet_fast_count.state }} - {%- else -%}null{%- endif -%} -- platform: statistics - name: internet_send_statistics - entity_id: sensor.internet_test_send - sampling_size: 100 - max_age: - hours: 2 -- platform: statistics - name: internet_receive_statistics - entity_id: sensor.internet_test_receive - sampling_size: 100 - max_age: - hours: 2 -- platform: statistics - name: internet_send_stdev_statistics - entity_id: sensor.internet_send_stdev - sampling_size: 100 - max_age: - hours: 2 -- platform: statistics - name: internet_receive_stdev_statistics - entity_id: sensor.internet_receive_stdev - sampling_size: 100 - max_age: - hours: 2 - -#- platform: history_stats -# name: internet_test_history -# entity_id: binary_sensor.internet_test -# state: on -# type: count -# start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}' -# end: '{{ now() }}' -#- platform: history_stats -# name: internet_slow_test_history -# entity_id: binary_sensor.internet_slow -# state: on -# type: count -# start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}' -# end: '{{ now() }}' -#- platform: history_stats -# name: internet_fast_test_history -# entity_id: binary_sensor.internet_fast -# state: on -# type: count -# start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}' -# end: '{{ now() }}' diff --git a/homeassistant/motion/makefile b/homeassistant/motion/makefile index c7cff350b..3839d43cc 100644 --- a/homeassistant/motion/makefile +++ b/homeassistant/motion/makefile @@ -60,6 +60,7 @@ WEBCAM_YAML := \ $(WEBCAM_GROUPS) \ $(WEBCAM_SENSORS) \ $(WEBCAM_SHELL_COMMANDS) +# $(WEBCAM_DEVICE_TRACKERS) \ ## ## HIGHLOW diff --git a/homeassistant/nmap/device_tracker b/homeassistant/nmap/device_tracker new file mode 120000 index 000000000..a8086be3e --- /dev/null +++ b/homeassistant/nmap/device_tracker @@ -0,0 +1 @@ +../device_tracker/nmap \ No newline at end of file diff --git a/homeassistant/device_tracker/nmap.yaml b/homeassistant/nmap/device_tracker.yaml.tmpl similarity index 100% rename from homeassistant/device_tracker/nmap.yaml rename to homeassistant/nmap/device_tracker.yaml.tmpl