View Source Changelog
3.0.0 (2023-08-12)
Breaking Changes
- Migrate built-in HTTP from
hackneytoFinch - Replace the
:adapterwith the:clientoption
Upgrade instructions
Dependencies
FritzApi now ships with an HTTP client based on :finch instead of :hackney.
Add :finch to your list of dependencies in mix.exs:
def deps do
[
{:fritz_api, "~> 3.0"},
{:finch, "~> 0.16"},
]
endHTTP client (optional)
Remove the
:adapterconfiguration fromFritzApi.Client.new/1:{:ok, client} = FritzApi.Client.new( - adapter: {Tesla.Adapter.Gun, []} )In
config/runtime.exsset the:fritz_api, :clientoption and to your own module that implements theFritzApi.HTTPClientbehaviour:+ config :fritz_api, + client: MyGunAdapter
See the documentation for FritzApi.HTTPClient for more information.
2.2.0 (2022-12-29)
- Fix deprecation warning
- Update dependencies
2.1.0 (2022-02-22)
- Bump elixir_xml_to_map to 3.0
2.0.0 (2020-11-27)
FritzApi 2.0 is a major release containing significant changes, particularly around the FritzApi.Client.
Enhancements
- Use tesla to make the underlying HTTP client configurable
Breaking Changes
- Replace the stateful
FritzApi.Clientthat would need to be started as part of a supervision tree with a simpler struct based approach:- Call
FritzApi.Client.new()to create a new client andFritzApi.Client.login(client, "user", "password")to authenticate with the Fritz API - See README for an example
- Call
- Switch functions like
FritzApi.get_switch_state/2return:on,:offatoms instead of a boolean, and:unknownif the actor is unavailable - Introduce a custom error struct (
FritzApi.Error) and use custom structs for actors (e.g.FritzApi.Switch) - Make hackney an optional dependency. To use the default
hackneybased adapter, add{:hackney, "~> 1.16"}to the list of dependencies.