Prints out a short summary of the class-instantiated object's attributes. :returns: A string with a short summary of the object's attributes. :rtype: str The returned string is made of the following components: * the :py:attr:`~easysensors.Sensor.desc
(self)
| 169 | pass |
| 170 | |
| 171 | def __str__(self): |
| 172 | """ |
| 173 | Prints out a short summary of the class-instantiated object's attributes. |
| 174 | |
| 175 | :returns: A string with a short summary of the object's attributes. |
| 176 | :rtype: str |
| 177 | |
| 178 | The returned string is made of the following components: |
| 179 | |
| 180 | * the :py:attr:`~easysensors.Sensor.descriptor`'s description |
| 181 | * the :py:attr:`~easysensors.Sensor.port` name |
| 182 | * the :py:attr:`~easysensors.Sensor.pin` identifier |
| 183 | * the :py:attr:`~easysensors.Sensor.portID` - see :py:meth:`~easysensors.Sensor.set_port` method. |
| 184 | |
| 185 | Sample of returned string as shown in a terminal: |
| 186 | |
| 187 | .. code-block:: console |
| 188 | |
| 189 | $ ultrasonic sensor on port AD1 |
| 190 | $ pinmode OUTPUT |
| 191 | $ portID 3 |
| 192 | |
| 193 | """ |
| 194 | return ("{} on port {} \npinmode {}\nportID {}".format(self.descriptor, |
| 195 | self.get_port(), self.get_pin_mode(), self.portID)) |
| 196 | |
| 197 | def set_pin(self, pin): |
| 198 | """ |
nothing calls this directly
no test coverage detected