WebThingsIO / android-app

A Web of Things client for Android
Mozilla Public License 2.0
6 stars 3 forks source link

Add thing #1

Open benfrancis opened 2 years ago

benfrancis commented 2 years ago

As a user I want to add a thing to my list of things so that I can monitor and control it over the internet.

Add by web thing URL (a URL which resolves to a WoT Thing Description 1.1).

benfrancis commented 2 years ago

Some initial ideas for the UI to add a Thing:

add_thing

  1. Tap "+"
  2. Enter web thing URL (this is going to be super clunky on mobile, which is why we're eventually going to need to add various discovery mechanisms, including directories)
  3. Tap "Submit"
  4. (Loads Thing Description in the background and displays a Thing icon. Currently all Things are just a generic "Thing" type for now. Displays editable title of the Thing from its Thing Description)
  5. Edit thing title and click "Add"
  6. (Thing icon displayed on the screen, currently with no interaction affordances so not very useful yet)

Open questions:

  1. I'm inconsistently using the terms "Thing" and "Device". Should it always be "Device"?
arist0v commented 2 years ago

I'm inconsistently using the terms "Thing" and "Device". Should it always be "Device"?

we should use Thing and ThingDirectory

Since the app should manage every Things(i like how it sound lol) shouldn'T we just , when we add ThingsDirectory add every Things that was found on the ThingsDirectory, so the Things page will have EVERY Things,

On Dashboard the user will be able to create custom dashboard with just some of the things that are already in the Things parts

benfrancis commented 2 years ago

Since the app should manage every Things(i like how it sound lol) shouldn'T we just , when we add ThingsDirectory add every Things that was found on the ThingsDirectory, so the Things page will have EVERY Things,

The WebThings App should work for individual web things (e.g. implemented using the WebThings Framework) as well as directories of web things (like WebThings Gateway).

But yes, if a user adds a gateway to the app we should store all the Thing Descriptions hosted by that gateway (the WoT Discovery specification also defines an API for being notified when things are added, removed or updated so that you can keep in sync).

See #13 for an explanation of why adding a whole gateway is currently more difficult than adding an individual Thing.

arist0v commented 2 years ago

i saw #13, but in my first attemp of an app, i was already able to retrieve every things from a gateway without issue. so adding a gateway will not be an issue vs adding things directory if we keep the things library compatible to both

so since, i could assume, a thing directory just kept link of wich things are in the directory, then we will create things object, gateway vs thing directory won'T have much difference and issue

you add gateway(or thingsdirectory) then you list thing and create object wich will be linked to the gateway(or directory) by passing the source as argument to the thing object(like the adapapter is passed as argument to the thing and the thing to the property etc....)

benfrancis commented 2 years ago

in my first attemp of an app, i was already able to retrieve every things from a gateway without issue

Out of interest, how did you handle authentication?

arist0v commented 2 years ago

I generate a token from the web gui and use it

Le lun. 23 mai 2022, 06 h 14, Ben Francis @.***> a écrit :

in my first attemp of an app, i was already able to retrieve every things from a gateway without issue

Out of interest, how did you handle authentication?

— Reply to this email directly, view it on GitHub https://github.com/WebThingsIO/android-app/issues/1#issuecomment-1134482794, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSPAAFCY7P4CAVLUIFO7ITVLNLCFANCNFSM5TNPHKEA . You are receiving this because you commented.Message ID: @.***>

benfrancis commented 2 years ago

Ah I see, so that requires users to manually generate a token in the gateway's web interface and then copy and paste it into the app? That is what I'm hoping to avoid. External apps and services should really authenticate with the gateway using OAuth.

I've created a next iteration of the UI mockups for this user story with an OAuth flow included.

add_thing-with_authentication

arist0v commented 2 years ago

yeah you told me about that, i had planned to use Oauth instead for this app.

Le lun. 23 mai 2022, à 07 h 36, Ben Francis @.***> a écrit :

Ah I see, so that requires users to manually generate a token in the gateway's web interface and then copy and paste it into the app? That is what I'm hoping to avoid. External apps and services should really authenticate with the gateway using OAuth.

I've created a next iteration of the UI mockups for this user story with an OAuth flow included.

[image: add_thing-with_authentication] https://user-images.githubusercontent.com/552417/169810421-38d91b15-86d2-40cf-ac43-dcf7cc3dcacb.png

— Reply to this email directly, view it on GitHub https://github.com/WebThingsIO/android-app/issues/1#issuecomment-1134561932, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSPAABZYTFF32GPBR7YNELVLNUUTANCNFSM5TNPHKEA . You are receiving this because you commented.Message ID: @.***>