summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordherrada <dylan.herrada@adafruit.com>2020-07-03 11:34:45 -0400
committerdherrada <dylan.herrada@adafruit.com>2020-07-03 11:34:45 -0400
commit0a657091c60e4c996f485508401370e7ae0f13b3 (patch)
treef96d9445e4b4537d202e294eb5129cfa0f820c5c
parentf8229372bd06eea08e97be5241352d521fa8972f (diff)
Added type hints to touchio
-rw-r--r--shared-bindings/touchio/TouchIn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c
index 0a9851cc5..50ca952ce 100644
--- a/shared-bindings/touchio/TouchIn.c
+++ b/shared-bindings/touchio/TouchIn.c
@@ -73,7 +73,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type,
return (mp_obj_t) self;
}
-//| def deinit(self) -> Any:
+//| def deinit(self) -> None:
//| """Deinitialises the TouchIn and releases any hardware resources for reuse."""
//| ...
//|
@@ -90,13 +90,13 @@ STATIC void check_for_deinit(touchio_touchin_obj_t *self) {
}
}
-//| def __enter__(self) -> Any:
+//| def __enter__(self) -> TouchIn:
//| """No-op used by Context Managers."""
//| ...
//|
// Provided by context manager helper.
-//| def __exit__(self) -> Any:
+//| def __exit__(self) -> None:
//| """Automatically deinitializes the hardware when exiting a context. See
//| :ref:`lifetime-and-contextmanagers` for more info."""
//| ...
@@ -108,7 +108,7 @@ STATIC mp_obj_t touchio_touchin_obj___exit__(size_t n_args, const mp_obj_t *args
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(touchio_touchin___exit___obj, 4, 4, touchio_touchin_obj___exit__);
-//| value: Any = ...
+//| value: bool = ...
//| """Whether the touch pad is being touched or not. (read-only)
//|
//| True when `raw_value` > `threshold`."""
@@ -128,7 +128,7 @@ const mp_obj_property_t touchio_touchin_value_obj = {
};
-//| raw_value: Any = ...
+//| raw_value: int = ...
//| """The raw touch measurement as an `int`. (read-only)"""
//|
STATIC mp_obj_t touchio_touchin_obj_get_raw_value(mp_obj_t self_in) {
@@ -147,7 +147,7 @@ const mp_obj_property_t touchio_touchin_raw_value_obj = {
};
-//| threshold: Any = ...
+//| threshold: Optional[int] = ...
//| """Minimum `raw_value` needed to detect a touch (and for `value` to be `True`).
//|
//| When the **TouchIn** object is created, an initial `raw_value` is read from the pin,