m-api Constructing the query string #139
Replies: 3 comments
-
Great! The m-api is based on GraphQL, I have not dabbled in it much myself, but it seems quite easy to work with |
Beta Was this translation helpful? Give feedback.
-
My initial thought about not creating a big Overview function was that if one part of the request fails, the rest will still work. So for example if a field in "user_trackings" is changed, then "smartplugs" part will still work. If an overview function is created then everything will stop working at once if any field is changed. But looking at your overview function i believe that it might make more sense anyway, since it will create a much cleaner interface for home-assistant. If we go for an overview function I might reconsider the dynamic building of a request, and go for a simpler interface of the sessions class, similar to how it was in in version 1. What's your take on this? |
Beta Was this translation helpful? Give feedback.
-
You are right, in the current way of working, if one of the requests fails, the other(s) still proceed. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've been playing with the m-api brach. I've setup mitmproxy to intercept traffic from my mobile device.
While browsing through the calls made, I noticed a regularity. In testing, I found that you can construct your own query string.
For example, this query will fetch all installations and from those retrieve the
giid
,alias
andpinCodeLength
.replace the newline characters with
\n
te create the python stringNow, let's add the
armState
as python string, this becomes:
And why not add more;
Beta Was this translation helpful? Give feedback.
All reactions