MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / updateBoxrouterData

Method updateBoxrouterData

src/astroprint/cloud.py:708–726  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

706 }
707
708 def updateBoxrouterData(self, data):
709 if self.cloud_enabled():
710 try:
711 if data:
712 r = requests.put("%s/astrobox/%s/update-boxrouter-data" % (self.apiHost, self.boxId),
713 data=json.dumps(data),
714 auth=self.hmacAuth,
715 headers={'Content-Type': 'application/json'}
716 )
717
718 if r.status_code == 200:
719 return r.json()
720 if r.status_code == 400:
721 self._logger.error("Bad updateBoxrouterData request (400). Response: %s" % r.text)
722 if r.status_code == 404:
723 self._logger.error("Request updateBoxrouterData not found (404). Response: %s" % r.text)
724 except Exception as e:
725 self._logger.error("Failed to send updateBoxrouterData request: %s" % e)
726 return False
727
728 def callFleetInfo(self):
729 if networkManager().isOnline():

Callers 1

setMethod · 0.80

Calls 2

cloud_enabledMethod · 0.95
errorMethod · 0.45

Tested by

no test coverage detected