feat(mikrotik_router): format release notes for better readability

This commit updates the handling of MikroTik RouterOS update release notes within the custom component. Specifically, it modifies the formatting of the release notes text by replacing instances of "*) " with "- ", in addition to converting newline characters to "<br />" HTML tags. This change aims to improve the readability of the release notes when displayed in the UI, making it easier for users to understand the changes in each RouterOS update.
This commit is contained in:
Sergey Krashevich 2024-04-12 15:12:01 +03:00
parent 04b0987781
commit 8e8ff310c1
No known key found for this signature in database
GPG key ID: 625171324E7D3856

View file

@ -97,7 +97,7 @@ class MikrotikRouterOSUpdate(MikrotikEntity, UpdateEntity):
)
if response.status_code == 200:
return response.text.replace(chr(10), "<br />")
return response.text.replace(chr(10), "<br />").replace("*) ", "- ")
except Exception as e:
_LOGGER.warning("Failed to download release notes (%s)", e)