A labeled statement can be used to exit a nested loop.
function loop () {
dance: for (let i = 0; i < 4; i++) {
for (let j = 0; j < 4; j++) {
if (j === 2) break dance
}
}
}
A labeled statement can be used to exit a nested loop.
function loop () {
dance: for (let i = 0; i < 4; i++) {
for (let j = 0; j < 4; j++) {
if (j === 2) break dance
}
}
}
Long press “Home Assistant” at the top
and the menu will switch to edit mode
The same can be achieved via the profile settings
Simply go to your Component.js file and add this line to the init
function:
this.getModel().setHeaders({"myCustomParameter": "test"})
In a CAP Backend, you get this parameter from the express req object, which can be accessed via the req.http property:
req.http.req.headers['myCustomParameter']
And here is a nice code snippet, on how to read this header parameter in an ABAP system: https://answers.sap.com/answers/425621/view.html
Every few months, I run into this issue when adding a torrent to transgui:
Although there is a 5-year-old closed issue on this bug, which also led to a code adjustment, this bug still seems to exist: https://github.com/transmission-remote-gui/transgui/issues/1270
The user Kethsar has probably already found the right cause and gives some hints on how to solve it. At least it helped me to find a workaround:
[AddTorrent.transmission]
section
Folder1=/my/path/1
FolHit1=1
FolExt1=
LastDt1=18.02.2024
Folder2=/my/path/2
FolHit2=3
FolExt2=
LastDt2=18.02.2024
...
It seems like the issues occurs, when the [AddTorrent.transmission]
section reaches Folder50
.
Somehow, I’ve only just realized that a badge icon can be used to display another entity status on a template card, even though it’s written in the documentation. I now use it to display the status of presence or motion sensors in the respective rooms.
badge_icon: >-
{{ "mdi:motion-sensor" if states("binary_sensor.0xb4e3f9fffeb689d4_occupancy") == "on" }}
badge_color: >-
{{ "green" if states("binary_sensor.0xb4e3f9fffeb689d4_occupancy") == "on" }}
Somehow I always forget that there is a boolean function in ABAP. That’s why I’m writing this post to hopefully remember it better. 🙂
If you just want to check something for truthiness, you can do it in the following three ways:
IF sy-subrc = 0.
result = abap_true.
ELSE.
result = abap_false.
ENDIF.
result = SWITCH #( sy-subrc WHEN 0 THEN abap_true
ELSE abap_false ).
result = xsdbool( sy-subrc = 0 )
If you are using the Launchpad Sandbox in your CAP project (like it is done here or here) and you want to change the logo in the header bar, simply add this little CSS snippet in the launchpad.html file:
<style>
#shell-header-icon {
content: url("./logo.png");
}
</style>
Of course you could also provide a base64 encoded image:
<style>
#shell-header-icon {
content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAGGoAAAVNCAYAAAAIhfswAA...);
}
</style>
So far, I have only made backups of my Home Assistant VM via Proxmox to my TrueNAS server. To also have a remote backup, I stumbled over Nextcloud Backup. For the add-on installation you have to add a repository, but after that the setup is straight forward.