]> git.basschouten.com Git - openhab-addons.git/commitdiff
[energidataservice] Update JRuby example (#16961)
authorjimtng <2554958+jimtng@users.noreply.github.com>
Sat, 29 Jun 2024 14:13:03 +0000 (00:13 +1000)
committerGitHub <noreply@github.com>
Sat, 29 Jun 2024 14:13:03 +0000 (16:13 +0200)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
bundles/org.openhab.binding.energidataservice/README.md

index ed764749db2303a51fe9ce19c7d52eaa2f191acd..48b969c8eb2570dc17d395279df21c56d942edea 100644 (file)
@@ -119,11 +119,11 @@ rule "Calculate total price" do
 
     time_series = TimeSeries.new # the default policy is replace
     spot_prices.each do |spot_price|
-      total_price = spot_price.state +
-                    GridTariff.persisted_state(spot_price.timestamp).state +
-                    SystemTariff.persisted_state(spot_price.timestamp).state +
-                    TransmissionGridTariff.persisted_state(spot_price.timestamp).state +
-                    ElectricityTax.persisted_state(spot_price.timestamp).state
+      total_price = spot_price +
+                    GridTariff.persisted_state(spot_price.timestamp) +
+                    SystemTariff.persisted_state(spot_price.timestamp) +
+                    TransmissionGridTariff.persisted_state(spot_price.timestamp) +
+                    ElectricityTax.persisted_state(spot_price.timestamp)
       time_series.add(spot_price.timestamp, total_price)
     end
     TotalPrice.persist(time_series)