java.lang.Object
io.openems.edge.timeofusetariff.tibber.Utils

public class Utils extends Object
  • Method Details

    • parsePrices

      protected static TimeOfUsePrices parsePrices(String jsonData, String filter) throws OpenemsError.OpenemsNamedException
      Parse the Tibber JSON to TimeOfUsePrices.

      If a filter is supplied, it is checked against 'id' (UUID) and 'appNickname'. If no filter is supplied, the method tries to be smart with finding the one unique correct result, i.e. it ignores empty/null objects.

      Parameters:
      jsonData - the Tibber JSON
      filter - filter for 'id' or 'appNickname'; null/blank for no filter
      Returns:
      the TimeOfUsePrices
      Throws:
      OpenemsError.OpenemsNamedException - on error
    • generateGraphQl

      protected static String generateGraphQl()
      Generate a GraphQL query.
      Returns:
      a query string