Leggin / dirigera

This repository provides an unofficial Python client for controlling the IKEA Dirigera Smart Home Hub.
MIT License
99 stars 19 forks source link

Make auth process more understandable #4

Closed fwinn closed 1 year ago

fwinn commented 1 year ago

I found it a little hard to understand how to run the generate-token script. I ended up cloning the project (after I had installed the module via pip), then looked for the according function and edited the file to call the main() function. I assume that this is not the way you're supposed to do it, right? So maybe explain it a bit better in README.md :D

Leggin commented 1 year ago

Hi, what was the part that confused you?

Is this clearer:

Quickstart

  1. Find out the ip-address of your Dirigera (check your router)
  2. Once you installed dirigera with pip you can run the included generate-token script. Here you can directly set the ip-address of you dirigera as parameter.
    generate-token <Dirigera ip-address>
  3. The script starts the auth process. When prompted, you must push the action button on Dirigera.
  4. After that hit ENTER and your token will be printed to the console.
    Example:
    Press the action button on Dirigera then hit ENTER ...
    Your Token:
    mgwB.aXqwpzV89N0aUwBhZMJjD8a.UBPyzy2InGtqgwo2MO5.xX4ug7.uBcVJquwYzLnAijF7SdYKvNxTo0uzQKahV10A-3ZQOz-UAubGP6sHWt1CJx3QmWZyE7ZcMZKgODXjSzWL1lumKgGz5dUIwFi3rhNxgK-IsBGeGVhNXPt8vGrYEcZePwPvNAIg8RqmlH27L-JZPnkAtP2wHoOdW72Djot3yJsohtEsb0p9mJvoZFSavTlTr4LDuf584vuH5fha5xoR9QhhIvvgbAP-s4EHFqENNi6vrYLHKR.sdqnv4sYw6UH-l6oiPnnRLxinoqBPOlWhlcL9doFviXQE.tZ9X8WVqyBrd0NYHlo9iorEvUbnZuD02BEJrg4NLwgh3rZtyF0Mi46HenynzBohbPn4RnuSYYCiHt5EZnWedxBtDqc7mSTm1ZtyD
  5. Done. Use this token in the hub setup.
    dirigera.Hub(
        token="mgwB.aXqwpzV89N0aUwBhZMJjD8a...",
        ip_address="192.1..."
    )
fwinn commented 1 year ago

Ooops, I didn't know that I could run the script from a normal console. I tried to somehow run it via the module. So it's fine either way. Sorry, my fault :D