code: def get_states(self, devices):
          
          header = BASE_HEADERS.copy()
          header['Cookie'] = self.__cookie
  
          json_data = self._create_get_state_request(devices)
  
          request = requests.post(
              BASE_URL + 'getStates',
              headers=header,
              data=json_data,
              timeout=10)
  
          if request.status_code != 200:
              self.__logged_in = False
              self.login()
              self.get_states(devices)
              return
  
          try:
              result = request.json()
          except ValueError as error:
              raise Exception(
                  "Not a valid result for" +
                  "getStates, protocol error:" + error)
  
          self._get_states(result)
docs: Get States of Devices.