From 9c740e2817bbc530b59e2ef2b3bf87784a2436ec Mon Sep 17 00:00:00 2001 From: Andre Cirne Date: Sun, 21 Apr 2024 08:05:13 +0100 Subject: [PATCH] Stop overwriting custom icons when it does a measurement #15 --- speedtest/rootfs/etc/services.d/speedtest/run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/speedtest/rootfs/etc/services.d/speedtest/run b/speedtest/rootfs/etc/services.d/speedtest/run index e50aa3c..5ced035 100755 --- a/speedtest/rootfs/etc/services.d/speedtest/run +++ b/speedtest/rootfs/etc/services.d/speedtest/run @@ -29,13 +29,13 @@ function post_result() { if [ "$sensor" = "ping" ]; then - local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"icon\":\"mdi:speedometer\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\"}}" + local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\"}}" elif [ "$sensor" = "download" ]; then local bytes=${7} - local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"icon\":\"mdi:speedometer\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\",\"bytes_received\":$bytes}}" + local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\",\"bytes_received\":$bytes}}" else local bytes=${7} - local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"icon\":\"mdi:speedometer\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\",\"bytes_sent\":$bytes}}" + local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\",\"bytes_sent\":$bytes}}" fi bashio::api.supervisor POST "/core/api/states/sensor.speedtest_$sensor" "$data"