Skip to content

Commit

Permalink
chore(dev): Improve .devcontainer
Browse files Browse the repository at this point in the history
* replace weather.home usage with demo sensors
* add support for CDE forwarding (local proxy) + forward 5000 & 8123
* add extra ui graph with color_threshholds edge-case
  • Loading branch information
jlsjonas committed Nov 13, 2022
1 parent 8577f2f commit c50ac9d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ lovelace:
type: module

default_config:
http: # support devcontainers/codespaces/gitpod
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
ip_ban_enabled: true
login_attempts_threshold: 5

demo:

Expand Down Expand Up @@ -38,3 +44,7 @@ sensor:
name: random_0_1000
minimum: 0
maximum: 1000
- platform: random
name: random_150_1000
minimum: 150
maximum: 1000
10 changes: 9 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,13 @@
"**/.hg/store/**": true,
"**/.rpt2_cache/**": true
}
}
},
"portsAttributes": {
"5000": {
"label": "rollup"
},
"8123": {
"label": "HA"
}
}
}
40 changes: 29 additions & 11 deletions .devcontainer/ui-lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@ views:
cards:
- type: custom:mini-graph-card
entities:
- sensor.humidity
- sensor.outside_humidity
- type: custom:mini-graph-card
entities:
- sensor.temperature
- type: custom:mini-graph-card
entities:
- sensor.pressure
- sensor.outside_temperature
show:
extrema: true
- type: custom:mini-graph-card
entities:
- entity: weather.home
attribute: pressure
- entity: sensor.outside_temperature
show:
extrema: true
- type: custom:mini-graph-card
Expand Down Expand Up @@ -48,17 +44,39 @@ views:
points: true
entities:
- entity: sensor.random_0_1000
name: log(0 - 1000) Gradients
name: log(150 - 1000) Gradients
aggregate_func: last
color_thresholds:
- value: 0
color: "#00ff00"
- value: 10
- value: 200
color: "#ffff00"
- value: 100
- value: 350
color: "#ff9900"
- value: 500
- value: 600
color: "#ff0000"
- type: custom:mini-graph-card
hours_to_show: 1
points_per_hour: 120
lower_bound: 0
upper_bound: 1000
# logarithmic: true
smoothing: false
height: 600
show:
extrema: true
# points: true
entities:
- entity: sensor.random_0_1000
name: log(150 - 1000) Simple
aggregate_func: last
color_thresholds:
- value: 0
color: green
- value: 200
color: red
- value: 1000
color: blue
- type: custom:mini-graph-card
entities:
- sensor.non_existant
Expand Down

0 comments on commit c50ac9d

Please sign in to comment.