v7.0.0
🚨 BREAKING🚨
- if you use
from_jsonon the output, that will now error. The output will already be a list or dictionary andfrom_jsonwill 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, usetime_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
floatconversion), a datetime value will be a datetime object, etc. So this means that:as_datetimenot longer needs to be applied in case the value is a datetime object (like formode='startormode='end') when notimeformatsetting is provided.- the
boolfunction or filter no longer needs to be applied in casemode='is_now'is used - a
floatorintconversion is no longer needed for numeric output, like formode='min'ormode='max' from_jsonis no longer needed to convert a json string to a list or dictionary, when egmode='list'ormode='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
- v7.0.0 beta - return native types by @TheFes in #219
- Update docs for v7 by @TheFes in #220
- Add
use_hourly_avgparameter by @TheFes in #227 - Fix bug with errors and with overnight check by @TheFes in #235
- Version number change for v7.0.0 stable by @TheFes in #236
Full Changelog: v6.0.6...v7.0.0