Code Monkey home page Code Monkey logo

fritzboxkit's Introduction

Fritz!Box Kit

CocoaPods Swift Package Manager compatible GitHub GitHub Workflow Status

This aims to be a Framework that provides a clean and modern Swift API for communicating with Fritz!Box routers. The focus is on home automation features.

Features

  • Authentication with API
  • Load device information (currently limited to thermostats and switches)
  • Toggle switches
  • Set Thermostat temperature
  • Load thermostat timetable
  • manipulate thermostat timetable

The Basics

Create an instance of the SDK with your myfritz URL and user credentials.

let fritzBox = FritzBox(
    host: "https://YOURID.myfritz.net:46048",
    user: "foo",
    password: "bar"
)

Get a session identifier by calling the login method. This will be used for all further requests.

fritzBox.login { result in
    if case .success(let info) = result {
        print("Info: \(String(describing: info))")
        // We are now ready to do further requests.
    }
}

You can now get information about devices and then act on them.

fritzBox.getDevices(completion: { result in
    if case .success(let devices) = result {
        print("Devices: \(String(describing: devices))")
        // Prints a list of devices and their properties.
    }
})

Hardware

As I only have one home, this was only tested with the following setup.

  • Fritz!Box 7490 (FRITZ!OS 6.83)
  • 3x Fritz Dect 300 thermostat
  • 1x Fritz Dect 301 thermostat

Installation

When using Swift Package Manager add this:

.package(url: "https://github.com/r-dent/FritzBoxKit.git", from: "0.5.0")

If you´re using CocoaPods, add this to your Podfile:

pod 'FritzBox-Kit'

fritzboxkit's People

Contributors

codeinho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.