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)
| 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 |