GIDs

Viewing 3 reply threads
  • Author
    Posts
    • #7640 Report Abuse
      wz2b
      Member

      When I make a request /customers/xxx/devices from the unofficial API I get back a number of GIDs.  Some of them come back as numbers, but some come back as null because I only have one Vue2 device.  The defensive position is to either ignore these fields or bring them in as interface{} unless somebody can clarify the types for me:

       

      CustomerGID: integer

      ChannelTypeGID: I think this is an integer but I’m not sure

      ParentChannelNum: I would think this would be an integer, but channel Num is a string in many other places where I would think it would be an integer, and in one case (where it is showing the voltage channels) it’s a string of comma-separated integers.   I’m not really sure what’s going on here but I think the intent is that it be a string because, even for the current (power) channels, there might be future provisions for eventually allowing multiple phase circuits to appear here as a list.  If that’s the case, this being a string might make sense.

      ParentDeviceGid is unpopulated – does it follow the other GIDs and it’s an integer?

      EvCharger – I don’t know what this type is so I had to leave it an interface{}

      UtilityRateGid – again, since it’s a GID, does this mean it’s an integer if present?

       

      For those unfamiliar with go, interface{} is a kind of way of saying ‘object of unknown type’ – basically it could be anything.

    • #7641 Report Abuse
      wz2b
      Member

      I hate answering my own questions but I think this forum software locks edit after a few minutes.  I realized that the channel numbers being a string is right because to get the overall house I request channel “1,2,3”.

      Another field I questioned was HotTub which is a bool wrapped in a string, and I’m not sure why.

       

    • #8457 Report Abuse
      ChrisShorter
      Member

      @wz2b

      Any chance you’d be willing to share any of your code?  I’d happily reciprocate — once I’ve done something ;).

      Thanks,


      @ChrisShorter

    • #8459 Report Abuse
      wz2b
      Member
Viewing 3 reply threads
  • You must be logged in to reply to this topic.