MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / get_remote_code

Method get_remote_code

Software/Python/easysensors.py:1456–1473  ·  view source on GitHub ↗

Returns the symbol of the pressed key in a string format. :return: The symbol that was pressed on the `Infrared Remote`_. :rtype: str Check the :py:attr:`~easysensors.Remote.keycodes` list for seeing what strings this method can return. On error or when not

(self)

Source from the content-addressed store, hash-verified

1454
1455
1456 def get_remote_code(self):
1457 """
1458 Returns the symbol of the pressed key in a string format.
1459
1460 :return: The symbol that was pressed on the `Infrared Remote`_.
1461 :rtype: str
1462
1463 Check the :py:attr:`~easysensors.Remote.keycodes` list for seeing what strings this method can return.
1464 On error or when nothing is read, an empty string is returned.
1465
1466 """
1467 string = ""
1468 key = self.read()
1469
1470 if key > 0 and key < len(self.keycodes)+1:
1471 string = self.keycodes[self.read()-1]
1472
1473 return string
1474##########################
1475
1476

Callers

nothing calls this directly

Calls 1

readMethod · 0.95

Tested by

no test coverage detected