Switch from mypy to pyright
This commit is contained in:
parent
7b26d3a160
commit
cc0c978f0c
12 changed files with 1000 additions and 17 deletions
224
typings/sense_hat/sense_hat.pyi
Normal file
224
typings/sense_hat/sense_hat.pyi
Normal file
|
|
@ -0,0 +1,224 @@
|
|||
"""
|
||||
This type stub file was generated by pyright.
|
||||
"""
|
||||
from sense_hat.stick import SenseStick
|
||||
|
||||
class SenseHat:
|
||||
SENSE_HAT_FB_NAME = ...
|
||||
SENSE_HAT_FB_FBIOGET_GAMMA = ...
|
||||
SENSE_HAT_FB_FBIOSET_GAMMA = ...
|
||||
SENSE_HAT_FB_FBIORESET_GAMMA = ...
|
||||
SENSE_HAT_FB_GAMMA_DEFAULT = ...
|
||||
SENSE_HAT_FB_GAMMA_LOW = ...
|
||||
SENSE_HAT_FB_GAMMA_USER = ...
|
||||
SETTINGS_HOME_PATH = ...
|
||||
def __init__(self, imu_settings_file=..., text_assets=...) -> None: ...
|
||||
@property
|
||||
def stick(self) -> SenseStick: ...
|
||||
@property
|
||||
def colour(self): ...
|
||||
|
||||
color = ...
|
||||
def has_colour_sensor(self): ...
|
||||
@property
|
||||
def rotation(self): ...
|
||||
@rotation.setter
|
||||
def rotation(self, r): ...
|
||||
def set_rotation(self, r=..., redraw=...): # -> None:
|
||||
"""
|
||||
Sets the LED matrix rotation for viewing, adjust if the Pi is upside
|
||||
down or sideways. 0 is with the Pi HDMI port facing downwards
|
||||
"""
|
||||
...
|
||||
def flip_h(self, redraw=...): # -> list[Any]:
|
||||
"""
|
||||
Flip LED matrix horizontal
|
||||
"""
|
||||
...
|
||||
def flip_v(self, redraw=...): # -> list[Any]:
|
||||
"""
|
||||
Flip LED matrix vertical
|
||||
"""
|
||||
...
|
||||
def set_pixels(self, pixel_list: list[tuple[int, int, int]]) -> None: # -> None:
|
||||
"""
|
||||
Accepts a list containing 64 smaller lists of [R,G,B] pixels and
|
||||
updates the LED matrix. R,G,B elements must integers between 0
|
||||
and 255
|
||||
"""
|
||||
...
|
||||
def get_pixels(self): # -> list[Any]:
|
||||
"""
|
||||
Returns a list containing 64 smaller lists of [R,G,B] pixels
|
||||
representing what is currently displayed on the LED matrix
|
||||
"""
|
||||
...
|
||||
def set_pixel(self, x, y, *args): # -> None:
|
||||
"""
|
||||
Updates the single [R,G,B] pixel specified by x and y on the LED matrix
|
||||
Top left = 0,0 Bottom right = 7,7
|
||||
|
||||
e.g. ap.set_pixel(x, y, r, g, b)
|
||||
or
|
||||
pixel = (r, g, b)
|
||||
ap.set_pixel(x, y, pixel)
|
||||
"""
|
||||
...
|
||||
def get_pixel(self, x, y): # -> list[int]:
|
||||
"""
|
||||
Returns a list of [R,G,B] representing the pixel specified by x and y
|
||||
on the LED matrix. Top left = 0,0 Bottom right = 7,7
|
||||
"""
|
||||
...
|
||||
def load_image(self, file_path, redraw=...): # -> list[list[Any]]:
|
||||
"""
|
||||
Accepts a path to an 8 x 8 image file and updates the LED matrix with
|
||||
the image
|
||||
"""
|
||||
...
|
||||
def clear(self, *args): # -> None:
|
||||
"""
|
||||
Clears the LED matrix with a single colour, default is black / off
|
||||
|
||||
e.g. ap.clear()
|
||||
or
|
||||
ap.clear(r, g, b)
|
||||
or
|
||||
colour = (r, g, b)
|
||||
ap.clear(colour)
|
||||
"""
|
||||
...
|
||||
def show_message(
|
||||
self, text_string, scroll_speed=..., text_colour=..., back_colour=...
|
||||
): # -> None:
|
||||
"""
|
||||
Scrolls a string of text across the LED matrix using the specified
|
||||
speed and colours
|
||||
"""
|
||||
...
|
||||
def show_letter(self, s, text_colour=..., back_colour=...): # -> None:
|
||||
"""
|
||||
Displays a single text character on the LED matrix using the specified
|
||||
colours
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def gamma(self): ...
|
||||
@gamma.setter
|
||||
def gamma(self, buffer): ...
|
||||
def gamma_reset(self): # -> None:
|
||||
"""
|
||||
Resets the LED matrix gamma correction to default
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def low_light(self): ...
|
||||
@low_light.setter
|
||||
def low_light(self, value): ...
|
||||
def get_humidity(self): # -> Literal[0]:
|
||||
"""
|
||||
Returns the percentage of relative humidity
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def humidity(self): ...
|
||||
def get_temperature_from_humidity(self): # -> Literal[0]:
|
||||
"""
|
||||
Returns the temperature in Celsius from the humidity sensor
|
||||
"""
|
||||
...
|
||||
def get_temperature_from_pressure(self): # -> Literal[0]:
|
||||
"""
|
||||
Returns the temperature in Celsius from the pressure sensor
|
||||
"""
|
||||
...
|
||||
def get_temperature(self): # -> Literal[0]:
|
||||
"""
|
||||
Returns the temperature in Celsius
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def temp(self): ...
|
||||
@property
|
||||
def temperature(self): ...
|
||||
def get_pressure(self): # -> Literal[0]:
|
||||
"""
|
||||
Returns the pressure in Millibars
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def pressure(self): ...
|
||||
def set_imu_config(self, compass_enabled, gyro_enabled, accel_enabled): # -> None:
|
||||
"""
|
||||
Enables and disables the gyroscope, accelerometer and/or magnetometer
|
||||
input to the orientation functions
|
||||
"""
|
||||
...
|
||||
def get_orientation_radians(self): # -> dict[str, Any] | dict[str, int]:
|
||||
"""
|
||||
Returns a dictionary object to represent the current orientation in
|
||||
radians using the aircraft principal axes of pitch, roll and yaw
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def orientation_radians(self): ...
|
||||
def get_orientation_degrees(self): # -> dict[str, Any] | dict[str, int]:
|
||||
"""
|
||||
Returns a dictionary object to represent the current orientation
|
||||
in degrees, 0 to 360, using the aircraft principal axes of
|
||||
pitch, roll and yaw
|
||||
"""
|
||||
...
|
||||
def get_orientation(self): ...
|
||||
@property
|
||||
def orientation(self): ...
|
||||
def get_compass(self): # -> int | None:
|
||||
"""
|
||||
Gets the direction of North from the magnetometer in degrees
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def compass(self): ...
|
||||
def get_compass_raw(self): # -> dict[str, Any] | dict[str, int]:
|
||||
"""
|
||||
Magnetometer x y z raw data in uT (micro teslas)
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def compass_raw(self): ...
|
||||
def get_gyroscope(self): # -> dict[str, Any] | dict[str, int]:
|
||||
"""
|
||||
Gets the orientation in degrees from the gyroscope only
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def gyro(self): ...
|
||||
@property
|
||||
def gyroscope(self): ...
|
||||
def get_gyroscope_raw(self): # -> dict[str, Any] | dict[str, int]:
|
||||
"""
|
||||
Gyroscope x y z raw data in radians per second
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def gyro_raw(self): ...
|
||||
@property
|
||||
def gyroscope_raw(self): ...
|
||||
def get_accelerometer(self): # -> dict[str, Any] | dict[str, int]:
|
||||
"""
|
||||
Gets the orientation in degrees from the accelerometer only
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def accel(self): ...
|
||||
@property
|
||||
def accelerometer(self): ...
|
||||
def get_accelerometer_raw(self): # -> dict[str, Any] | dict[str, int]:
|
||||
"""
|
||||
Accelerometer x y z raw data in Gs
|
||||
"""
|
||||
...
|
||||
@property
|
||||
def accel_raw(self): ...
|
||||
@property
|
||||
def accelerometer_raw(self): ...
|
||||
Reference in a new issue