mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 18:06:36 +00:00
Automation icon tweaks (#13495)
This commit is contained in:
parent
44e38cd24e
commit
35fa763086
@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
mdiAbTesting,
|
mdiAbTesting,
|
||||||
mdiAlertOctagon,
|
|
||||||
mdiArrowDecision,
|
mdiArrowDecision,
|
||||||
mdiArrowUp,
|
mdiArrowUp,
|
||||||
mdiAsterisk,
|
mdiAsterisk,
|
||||||
@ -12,15 +11,16 @@ import {
|
|||||||
mdiChevronDown,
|
mdiChevronDown,
|
||||||
mdiChevronUp,
|
mdiChevronUp,
|
||||||
mdiClose,
|
mdiClose,
|
||||||
mdiCloseOctagon,
|
mdiCodeBraces,
|
||||||
mdiCodeBrackets,
|
mdiCodeBrackets,
|
||||||
mdiDevices,
|
mdiDevices,
|
||||||
mdiExclamation,
|
mdiGestureDoubleTap,
|
||||||
|
mdiHandBackRight,
|
||||||
|
mdiPalette,
|
||||||
mdiRefresh,
|
mdiRefresh,
|
||||||
mdiRoomService,
|
mdiRoomService,
|
||||||
mdiShuffleDisabled,
|
mdiShuffleDisabled,
|
||||||
mdiTimerOutline,
|
mdiTimerOutline,
|
||||||
mdiTrafficLight,
|
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import { css, html, LitElement, PropertyValues } from "lit";
|
import { css, html, LitElement, PropertyValues } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
@ -46,7 +46,6 @@ import {
|
|||||||
ChooseActionTraceStep,
|
ChooseActionTraceStep,
|
||||||
ConditionTraceStep,
|
ConditionTraceStep,
|
||||||
IfActionTraceStep,
|
IfActionTraceStep,
|
||||||
StopActionTraceStep,
|
|
||||||
TraceExtended,
|
TraceExtended,
|
||||||
} from "../../data/trace";
|
} from "../../data/trace";
|
||||||
import "../ha-icon-button";
|
import "../ha-icon-button";
|
||||||
@ -419,7 +418,7 @@ export class HatScriptGraph extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<hat-graph-node
|
<hat-graph-node
|
||||||
.graphStart=${graphStart}
|
.graphStart=${graphStart}
|
||||||
.iconPath=${mdiExclamation}
|
.iconPath=${mdiGestureDoubleTap}
|
||||||
@focus=${this.selectNode(node, path)}
|
@focus=${this.selectNode(node, path)}
|
||||||
?track=${path in this.trace.trace}
|
?track=${path in this.trace.trace}
|
||||||
?active=${this.selected === path}
|
?active=${this.selected === path}
|
||||||
@ -485,7 +484,7 @@ export class HatScriptGraph extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<hat-graph-node
|
<hat-graph-node
|
||||||
.graphStart=${graphStart}
|
.graphStart=${graphStart}
|
||||||
.iconPath=${mdiExclamation}
|
.iconPath=${mdiPalette}
|
||||||
@focus=${this.selectNode(node, path)}
|
@focus=${this.selectNode(node, path)}
|
||||||
?track=${path in this.trace.trace}
|
?track=${path in this.trace.trace}
|
||||||
?active=${this.selected === path}
|
?active=${this.selected === path}
|
||||||
@ -523,7 +522,7 @@ export class HatScriptGraph extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<hat-graph-node
|
<hat-graph-node
|
||||||
.graphStart=${graphStart}
|
.graphStart=${graphStart}
|
||||||
.iconPath=${mdiTrafficLight}
|
.iconPath=${mdiCodeBraces}
|
||||||
@focus=${this.selectNode(node, path)}
|
@focus=${this.selectNode(node, path)}
|
||||||
?track=${path in this.trace.trace}
|
?track=${path in this.trace.trace}
|
||||||
?active=${this.selected === path}
|
?active=${this.selected === path}
|
||||||
@ -587,13 +586,10 @@ export class HatScriptGraph extends LitElement {
|
|||||||
graphStart = false,
|
graphStart = false,
|
||||||
disabled = false
|
disabled = false
|
||||||
) {
|
) {
|
||||||
const trace = this.trace.trace[path] as StopActionTraceStep[] | undefined;
|
|
||||||
return html`
|
return html`
|
||||||
<hat-graph-node
|
<hat-graph-node
|
||||||
.graphStart=${graphStart}
|
.graphStart=${graphStart}
|
||||||
.iconPath=${trace?.[0].result?.error
|
.iconPath=${mdiHandBackRight}
|
||||||
? mdiAlertOctagon
|
|
||||||
: mdiCloseOctagon}
|
|
||||||
@focus=${this.selectNode(node, path)}
|
@focus=${this.selectNode(node, path)}
|
||||||
?track=${path in this.trace.trace}
|
?track=${path in this.trace.trace}
|
||||||
?active=${this.selected === path}
|
?active=${this.selected === path}
|
||||||
|
@ -2,9 +2,10 @@ import {
|
|||||||
mdiAbTesting,
|
mdiAbTesting,
|
||||||
mdiArrowDecision,
|
mdiArrowDecision,
|
||||||
mdiCallSplit,
|
mdiCallSplit,
|
||||||
mdiCloseOctagon,
|
mdiCodeBraces,
|
||||||
mdiDevices,
|
mdiDevices,
|
||||||
mdiExclamation,
|
mdiGestureDoubleTap,
|
||||||
|
mdiHandBackRight,
|
||||||
mdiPalette,
|
mdiPalette,
|
||||||
mdiPlay,
|
mdiPlay,
|
||||||
mdiRefresh,
|
mdiRefresh,
|
||||||
@ -17,16 +18,16 @@ import {
|
|||||||
export const ACTION_TYPES = {
|
export const ACTION_TYPES = {
|
||||||
condition: mdiAbTesting,
|
condition: mdiAbTesting,
|
||||||
delay: mdiTimerOutline,
|
delay: mdiTimerOutline,
|
||||||
event: mdiExclamation,
|
event: mdiGestureDoubleTap,
|
||||||
play_media: mdiPlay,
|
play_media: mdiPlay,
|
||||||
activate_scene: mdiPalette,
|
activate_scene: mdiPalette,
|
||||||
service: mdiRoomService,
|
service: mdiRoomService,
|
||||||
wait_template: mdiTrafficLight,
|
wait_template: mdiCodeBraces,
|
||||||
wait_for_trigger: mdiTrafficLight,
|
wait_for_trigger: mdiTrafficLight,
|
||||||
repeat: mdiRefresh,
|
repeat: mdiRefresh,
|
||||||
choose: mdiArrowDecision,
|
choose: mdiArrowDecision,
|
||||||
if: mdiCallSplit,
|
if: mdiCallSplit,
|
||||||
device_id: mdiDevices,
|
device_id: mdiDevices,
|
||||||
stop: mdiCloseOctagon,
|
stop: mdiHandBackRight,
|
||||||
parallel: mdiShuffleDisabled,
|
parallel: mdiShuffleDisabled,
|
||||||
};
|
};
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
mdiAmpersand,
|
mdiAmpersand,
|
||||||
mdiCancel,
|
|
||||||
mdiClockOutline,
|
mdiClockOutline,
|
||||||
mdiCodeBraces,
|
mdiCodeBraces,
|
||||||
mdiDevices,
|
mdiDevices,
|
||||||
mdiExclamation,
|
|
||||||
mdiGateOr,
|
mdiGateOr,
|
||||||
|
mdiIdentifier,
|
||||||
mdiMapMarkerRadius,
|
mdiMapMarkerRadius,
|
||||||
|
mdiNotEqualVariant,
|
||||||
mdiNumeric,
|
mdiNumeric,
|
||||||
mdiStateMachine,
|
mdiStateMachine,
|
||||||
mdiWeatherSunny,
|
mdiWeatherSunny,
|
||||||
@ -16,12 +16,12 @@ export const CONDITION_TYPES = {
|
|||||||
device: mdiDevices,
|
device: mdiDevices,
|
||||||
and: mdiAmpersand,
|
and: mdiAmpersand,
|
||||||
or: mdiGateOr,
|
or: mdiGateOr,
|
||||||
not: mdiCancel,
|
not: mdiNotEqualVariant,
|
||||||
state: mdiStateMachine,
|
state: mdiStateMachine,
|
||||||
numeric_state: mdiNumeric,
|
numeric_state: mdiNumeric,
|
||||||
sun: mdiWeatherSunny,
|
sun: mdiWeatherSunny,
|
||||||
template: mdiCodeBraces,
|
template: mdiCodeBraces,
|
||||||
time: mdiClockOutline,
|
time: mdiClockOutline,
|
||||||
trigger: mdiExclamation,
|
trigger: mdiIdentifier,
|
||||||
zone: mdiMapMarkerRadius,
|
zone: mdiMapMarkerRadius,
|
||||||
};
|
};
|
||||||
|
@ -119,7 +119,7 @@ export const describeAction = <T extends ActionType>(
|
|||||||
entityId = config.target?.entity_id || config.entity_id;
|
entityId = config.target?.entity_id || config.entity_id;
|
||||||
}
|
}
|
||||||
const sceneStateObj = entityId ? hass.states[entityId] : undefined;
|
const sceneStateObj = entityId ? hass.states[entityId] : undefined;
|
||||||
return `Activate scene ${
|
return `Scene ${
|
||||||
sceneStateObj
|
sceneStateObj
|
||||||
? computeStateName(sceneStateObj)
|
? computeStateName(sceneStateObj)
|
||||||
: "scene" in config
|
: "scene" in config
|
||||||
@ -154,9 +154,9 @@ export const describeAction = <T extends ActionType>(
|
|||||||
if (actionType === "fire_event") {
|
if (actionType === "fire_event") {
|
||||||
const config = action as EventAction;
|
const config = action as EventAction;
|
||||||
if (isTemplate(config.event)) {
|
if (isTemplate(config.event)) {
|
||||||
return "Fire event based on a template";
|
return "Event based on a template";
|
||||||
}
|
}
|
||||||
return `Fire event ${config.event}`;
|
return `Event ${config.event}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actionType === "wait_template") {
|
if (actionType === "wait_template") {
|
||||||
|
@ -4,7 +4,7 @@ import {
|
|||||||
mdiClockOutline,
|
mdiClockOutline,
|
||||||
mdiCodeBraces,
|
mdiCodeBraces,
|
||||||
mdiDevices,
|
mdiDevices,
|
||||||
mdiExclamation,
|
mdiGestureDoubleTap,
|
||||||
mdiHomeAssistant,
|
mdiHomeAssistant,
|
||||||
mdiMapMarker,
|
mdiMapMarker,
|
||||||
mdiMapMarkerRadius,
|
mdiMapMarkerRadius,
|
||||||
@ -19,7 +19,7 @@ import {
|
|||||||
export const TRIGGER_TYPES = {
|
export const TRIGGER_TYPES = {
|
||||||
calendar: mdiCalendar,
|
calendar: mdiCalendar,
|
||||||
device: mdiDevices,
|
device: mdiDevices,
|
||||||
event: mdiExclamation,
|
event: mdiGestureDoubleTap,
|
||||||
state: mdiStateMachine,
|
state: mdiStateMachine,
|
||||||
geo_location: mdiMapMarker,
|
geo_location: mdiMapMarker,
|
||||||
homeassistant: mdiHomeAssistant,
|
homeassistant: mdiHomeAssistant,
|
||||||
|
@ -508,8 +508,15 @@ export default class HaAutomationActionRow extends LitElement {
|
|||||||
--expansion-panel-content-padding: 0;
|
--expansion-panel-content-padding: 0;
|
||||||
}
|
}
|
||||||
.action-icon {
|
.action-icon {
|
||||||
color: var(--sidebar-icon-color);
|
display: none;
|
||||||
padding-right: 8px;
|
}
|
||||||
|
@media (min-width: 870px) {
|
||||||
|
.action-icon {
|
||||||
|
display: inline-block;
|
||||||
|
color: var(--primary-color);
|
||||||
|
opacity: 0.9;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.card-content {
|
.card-content {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
@ -424,8 +424,15 @@ export default class HaAutomationConditionRow extends LitElement {
|
|||||||
--expansion-panel-content-padding: 0;
|
--expansion-panel-content-padding: 0;
|
||||||
}
|
}
|
||||||
.condition-icon {
|
.condition-icon {
|
||||||
color: var(--sidebar-icon-color);
|
display: none;
|
||||||
padding-right: 8px;
|
}
|
||||||
|
@media (min-width: 870px) {
|
||||||
|
.condition-icon {
|
||||||
|
display: inline-block;
|
||||||
|
color: var(--primary-color);
|
||||||
|
opacity: 0.9;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.card-content {
|
.card-content {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
@ -347,8 +347,15 @@ export class HaManualAutomationEditor extends LitElement {
|
|||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
.settings-icon {
|
.settings-icon {
|
||||||
color: var(--sidebar-icon-color);
|
display: none;
|
||||||
padding-right: 8px;
|
}
|
||||||
|
@media (min-width: 870px) {
|
||||||
|
.settings-icon {
|
||||||
|
display: inline-block;
|
||||||
|
color: var(--primary-color);
|
||||||
|
opacity: 0.9;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.disabled-bar {
|
.disabled-bar {
|
||||||
background: var(--divider-color, #e0e0e0);
|
background: var(--divider-color, #e0e0e0);
|
||||||
|
@ -533,8 +533,15 @@ export default class HaAutomationTriggerRow extends LitElement {
|
|||||||
--expansion-panel-content-padding: 0;
|
--expansion-panel-content-padding: 0;
|
||||||
}
|
}
|
||||||
.trigger-icon {
|
.trigger-icon {
|
||||||
color: var(--sidebar-icon-color);
|
display: none;
|
||||||
padding-right: 8px;
|
}
|
||||||
|
@media (min-width: 870px) {
|
||||||
|
.trigger-icon {
|
||||||
|
display: inline-block;
|
||||||
|
color: var(--primary-color);
|
||||||
|
opacity: 0.9;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.card-content {
|
.card-content {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
@ -2113,7 +2113,7 @@
|
|||||||
"label": "Condition"
|
"label": "Condition"
|
||||||
},
|
},
|
||||||
"event": {
|
"event": {
|
||||||
"label": "Fire event",
|
"label": "Event",
|
||||||
"event": "[%key:ui::panel::config::automation::editor::triggers::type::event::label%]",
|
"event": "[%key:ui::panel::config::automation::editor::triggers::type::event::label%]",
|
||||||
"event_data": "[%key:ui::panel::config::automation::editor::triggers::type::event::event_data%]"
|
"event_data": "[%key:ui::panel::config::automation::editor::triggers::type::event::event_data%]"
|
||||||
},
|
},
|
||||||
@ -2133,7 +2133,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"activate_scene": {
|
"activate_scene": {
|
||||||
"label": "Activate scene",
|
"label": "Scene",
|
||||||
"scene": "Scene"
|
"scene": "Scene"
|
||||||
},
|
},
|
||||||
"repeat": {
|
"repeat": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user