3 files
This commit is contained in:
@@ -483,55 +483,9 @@
|
||||
"type": "horizontal-stack",
|
||||
"cards": [
|
||||
{
|
||||
"type": "custom:button-card",
|
||||
"entity": "binary_sensor.octoprint_connected",
|
||||
"show_name": false,
|
||||
"show_icon": false,
|
||||
"tap_action": {
|
||||
"action": "none"
|
||||
},
|
||||
"custom_fields": {
|
||||
"content": "[[[\n const connected = states['binary_sensor.octoprint_connected']?.state === 'on';\n const printing = states['binary_sensor.octoprint_printing']?.state === 'on';\n const paused = states['binary_sensor.octoprint_paused']?.state === 'on';\n const prints = states['sensor.octoprint_printer_prints_today']?.state || '0';\n const ptime = states['sensor.octoprint_printer_print_time_today']?.state || '--';\n const fil = ((parseFloat(states['sensor.octoprint_filament_daily']?.state) || 0) / 10).toFixed(1);\n\n const row = (label, value, vc) => `\n <div style=\"display:grid; grid-template-columns:1fr auto; align-items:center; padding:5px 0; border-bottom:1px solid rgba(var(--rgb-primary-text-color),0.06); width:100%;\">\n <span style=\"font-size:12px; color:var(--secondary-text-color);\">${label}</span>\n <span style=\"font-size:12px; font-weight:500; color:${vc || 'var(--primary-text-color)'}; text-align:right;\">${value}</span>\n </div>`;\n return `\n <div style=\"position:absolute; top:14px; left:16px; right:16px; bottom:14px; display:flex; flex-direction:column;\">\n <div style=\"display:flex; align-items:center; gap:5px; margin-bottom:10px;\">\n <ha-icon icon=\"mdi:stethoscope\" style=\"color:#4CAF50; --mdc-icon-size:14px;\"></ha-icon>\n <span style=\"font-size:11px; color:var(--secondary-text-color); text-transform:uppercase; letter-spacing:0.05em;\">Diagnostics</span>\n </div>\n ${row('Connected', connected ? 'Yes' : 'No', connected ? '#4CAF50' : '#F44336')}\n ${row('Status', printing ? (paused ? 'Paused' : 'Printing') : 'Idle', printing ? '#4CAF50' : null)}\n ${row('Prints today', prints, null)}\n ${row('Time today', ptime + ' h', null)}\n ${row('Filament today', fil + ' m', null)}\n </div>\n `;\n ]]]"
|
||||
},
|
||||
"styles": {
|
||||
"card": [
|
||||
{
|
||||
"background": "var(--ha-card-background, var(--card-background-color))"
|
||||
},
|
||||
{
|
||||
"border-radius": "12px"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
},
|
||||
{
|
||||
"height": "74px"
|
||||
},
|
||||
{
|
||||
"position": "relative"
|
||||
},
|
||||
{
|
||||
"box-shadow": "none"
|
||||
},
|
||||
{
|
||||
"height": "190px"
|
||||
}
|
||||
],
|
||||
"custom_fields": {
|
||||
"content": [
|
||||
{
|
||||
"position": "absolute"
|
||||
},
|
||||
{
|
||||
"inset": "0"
|
||||
},
|
||||
{
|
||||
"padding": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://endercamera2.duckdns.org/stream"
|
||||
"type": "custom:webrtc-camera",
|
||||
"url": "https://endercamera2.duckdns.org/stream",
|
||||
"style": "border-radius: 12px 12px 0 0; overflow: hidden;"
|
||||
},
|
||||
{
|
||||
"type": "vertical-stack",
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
{
|
||||
"type": "custom:webrtc-camera",
|
||||
"url": "https://endercamera2.duckdns.org/stream",
|
||||
"mode": "mse",
|
||||
"grid_options": {
|
||||
"columns": "full"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user