Skip to content

v7.0.0

Choose a tag to compare

@TheFes TheFes released this 17 Oct 13:34
7fdc65b

🚨 BREAKING🚨

  • if you use from_json on the output, that will now error. The output will already be a list or dictionary and from_json will not be able to convert it
  • If the output is a dictionary like when mode='all' is used, the template parser will struggle with the datetime values in that object. It will not be an issue when you use the output directly, but it might cuase issues when you e.g. put it in an attribute of a template sensor, as the datetime values will break the dictionary and it will be a big string instead. To avoid this, use time_format='isoformat' to convert the datetime objects to isoformat strings.

🌟 IMPROVEMENTS

  • Instead of always returning a string, this version now returns the native type. This means that a numeric value will already be a number (no need to a float conversion), a datetime value will be a datetime object, etc. So this means that:
    • as_datetime not longer needs to be applied in case the value is a datetime object (like for mode='start or mode='end') when no timeformat setting is provided.
    • the bool function or filter no longer needs to be applied in case mode='is_now' is used
    • a float or int conversion is no longer needed for numeric output, like for mode='min' or mode='max'
    • from_json is no longer needed to convert a json string to a list or dictionary, when eg mode='list' or mode='all' is used

✨ NEW FEATURS

  • As of 1st of October quarterly prices are used. So integrations like Nordpool now provide these quarterly prices. However, it could be that your energy provider still uses hourly prices. If you want to find the best time or price based on hourly rates, you can use use_hourly_avg=true. The macro will then recalculate the quarterly prices to hourly averages.
  • time_format='isoformat' can be used to let the macro return isoformat datetime strings instead of datetime objects. This is added because the template parser returns datetime objects in the Python datetime format if they are part of a dictionary.

🐛 BUG FIXES

  • The check to append the start or end time if the end was before the start would also be applied if start or end was already including the date. This would make the macro return output where an error was expected. The start/end time will no longer be changed by the overnight check in case the full date was already provided.

What's Changed

Full Changelog: v6.0.6...v7.0.0