code: def publish_state(self, state):
          
          message = json.dumps({'state': {'reported': state}})
          self.client.publish(self.topic, message)
          self._state = state
docs: Publish thing state to AWS IoT.
  
          Args:
              state (dict): object state. Must be JSON serializable (i.e., not
                  have circular references).