feat: expand advanced widget experiences
This commit is contained in:
1 parent
9437d211c8
commit
c099a8eef6
119 files changed
+3624
-844
No files matched your search
@@ -157,6 +157,11 @@ export default function SmartHomeEntityStateWidget({
|
||||
<Text size="xs" c="dimmed">
|
||||
{t("advanced.entityId", { id: entity.entity_id })}
|
||||
</Text>
|
||||
<Text size="xs" c="dimmed">
|
||||
{t("advanced.lastChanged", {
|
||||
date: new Date(entity.last_changed).toLocaleString(locale),
|
||||
})}
|
||||
</Text>
|
||||
<Text size="xs" c="dimmed">
|
||||
{t("advanced.lastUpdated", {
|
||||
date: new Date(entity.last_updated).toLocaleString(locale),
|
||||
|
||||
@@ -138,23 +138,30 @@ export default function SmartHomeTriggerAutomationWidget({
|
||||
{options.displayName}
|
||||
</Text>
|
||||
{displayMode === "advanced" && (
|
||||
<>
|
||||
{error ? (
|
||||
<Stack gap={2} align="center">
|
||||
<Text ta="center" size="xs" c="dimmed">
|
||||
{t("widget.smartHome-executeAutomation.advanced.automationId", { id: options.automationId })}
|
||||
</Text>
|
||||
<Text ta="center" size="xs" c={canInteract ? "dimmed" : "orange"}>
|
||||
{t(
|
||||
canInteract
|
||||
? "widget.smartHome-executeAutomation.advanced.ready"
|
||||
: "widget.smartHome-executeAutomation.advanced.noPermission",
|
||||
)}
|
||||
</Text>
|
||||
{lastExecutedAt && (
|
||||
<Text ta="center" size="xs" c="dimmed">
|
||||
{t("widget.smartHome-executeAutomation.advanced.lastExecuted", {
|
||||
time: lastExecutedAt.toLocaleTimeString(locale),
|
||||
})}
|
||||
</Text>
|
||||
)}
|
||||
{error && (
|
||||
<Text ta="center" size="xs" c="red">
|
||||
{t("widget.smartHome-executeAutomation.error.executeFailed")}
|
||||
</Text>
|
||||
) : (
|
||||
<Text ta="center" size="xs" c="dimmed">
|
||||
{lastExecutedAt
|
||||
? t("widget.smartHome-executeAutomation.advanced.lastExecuted", {
|
||||
time: lastExecutedAt.toLocaleTimeString(locale),
|
||||
})
|
||||
: t("widget.smartHome-executeAutomation.advanced.automationId", {
|
||||
id: options.automationId,
|
||||
})}
|
||||
</Text>
|
||||
)}
|
||||
</>
|
||||
</Stack>
|
||||
)}
|
||||
</Stack>
|
||||
</Center>
|
||||
|
||||
Reference in new issue
Block a user