A Python library for Misty II development
Project description
Misty2py
Misty2py is a Python 3 library for Misty II development using Misty API.
Features
Misty2py can be used to develop complex skills (behaviours) for the Misty II robot utilising:
- actions via sending a
POSTorDELETErequests to Misty's API; - informations via sending a
GETrequest to Misty's API; - continuous streams of data via subscribing to event types on Misty's websockets.
Misty2py uses following concepts for easy of usage:
- action keywords - customisable python-styled keywords for endpoints of Misty's API that correspond to performing actions;
- information keywords - customisable python-styled keywords for endpoints of Misty's API that correspond to retrieving information;
- data shortcuts - customisable python-styled keywords for commonly used data that are supplied to Misty's API as the body of a
POSTrequest.
Usage
Getting started
- Start by making a new instance of
misty2py.robot'sMistybymisty_robot = Misty("ip_address_here")- Substitute
ip_address_herewith the IP address of your Misty. misty2py.utils.env_loadermodule containsEnvLoaderclass that can be used to load Misty's IP from the .env file in your project's home directory:- Create the
.envfile and writeMISTY_IP_ADDRESS="[ip_address_here]"in it. - Initialise an
EnvLoaderobject viaenv_loader = EnvLoader(); this loads the environment variables. - Use
env_loader.get_ip()to obtain the IP address.
- Create the
- Substitute
- Use the method
misty_robot.perform_action()to tell Misty to perform an action. - Use the method
misty_robot.get_info()to tell Misty to return information. - Use the method
misty_robot.event()to initialise, obtain and stop continuous streams of data from Misty's event types.
Obtaining information
Obtaining digital information is handled by misty2py.robot::get_info method.
misty2py.robot::get_info has following arguments:
info_name- required; the string information keyword corresponding to an endpoint in Misty's API;params- optional; a dictionary of parameter name and parameter value pairs, defaults to{}.
Performing actions
Performing physical and digital actions including removal of non-system files is handled by misty2py.robot::perform_action() method.
misty2py.robot::perform_action() has following arguments:
action_name- required; the string action keyword corresponding to an endpoint in Misty's API;data- optional; the data to pass to the request as a dictionary or a data shortcut (string), defaults to{}.
Event types
To obtain event data in Misty's framework, it is required to subscribe to an event type on Misty's websocket server. Misty's websocket server then streams data to the websocket client, in this implementation via a separate thread. To access this data, misty2py.robot::event method must be called with "get_data" parameter from the main thread. When data are no longer required to be streamed to the client, an event type can be unsubscribed to kill the event thread.
Subscription
Subscribe to an event via misty2py.robot::event with the parameter "subscribe" and following keyword arguments:
- `type` - *required;* event type string as documented in [Event Types Docs](https://docs.mistyrobotics.com/misty-ii/robot/sensor-data/ "Misty Robotics Event Types").
- `name` - *optional;* a custom event name string; must be unique.
- `return_property` - *optional;* the property to return from Misty's websockets; all properties are returned if return_property is not supplied.
- `debounce` - *optional;* the interval in ms at which new information is sent; defaults to 250.
- `len_data_entries` - *optional;* the maximum number of data entries to keep (discards in fifo style); defaults to 10.
- `event_emitter` - *optional;* an event emitter function which emits an event upon message recieval. Supplies the message content as an argument.
Accessing the data and the log
Access the data of an event or its log via misty2py.robot::event with the parameter "get_data" or "get_log" and a keyword argument name (the name of the event).
Unsubscribing
Unsubscribe from an event via misty2py.robot::event with the parameter "unsubscribe" and a keyword argument name (the name of the event).
Basic example
import time
from misty2py.robot import Misty
from misty2py.utils.env_loader import EnvLoader
env_loader = EnvLoader
m = Misty(env_loader.get_ip())
d = m.event("subscribe", type = "BatteryCharge")
e_name = d.get("event_name")
time.sleep(1)
d = m.event("get_data", name = e_name)
d = m.event("unsubscribe", name = e_name)
Event emitter usage - example
import time
from pymitter import EventEmitter
from misty2py.robot import Misty
from misty2py.utils.env_loader import EnvLoader
env_loader = EnvLoader
m = Misty(env_loader.get_ip())
ee = EventEmitter()
event_name = "myevent_001"
@ee.on(event_name)
def listener(data):
print(data)
d = m.event("subscribe", type = "BatteryCharge", name = event_name, event_emitter = ee)
time.sleep(2)
d = m.event("unsubscribe", name = event_name)
Utilities
The sub-package misty2py.utils contains utility modules, including:
-
misty2py.utils.base64- contains base64 encoders and decoders.misty2py.utils.base64::content_to_base64- encodes a string or a file into base64 string and either returns the encoded string or saves the encoded string into a file.misty2py.utils.base64::base64_to_content- decodes a string or a file from base64 and either returns the decoded string or saves the decoded file.
-
misty2py.utils.colours- contains colour-related utility functions.misty2py.utils.colours::parse_rgb_value- parses and validates a potentially rgb value (a string or an integer).misty2py.utils.colours::rgb_values_to_dict- turns integer or string triple of rgb values into the rgb dictionary form required by Misty API.misty2py.utils.colours::validate_rgb_dict- validates an rgb dictionary.misty2py.utils.colours::get_rgb_from_unknown- attempts to obtain an rgb dictionary from an unknown data content (possibly a data shortcut or a dictionary)misty2py.utils.colours::construct_transition_dict- constructs the transition dictionary as required by Misty API from a dictionary of two colours supplied either as data shortcuts or rgb dictionaries.
-
misty2py.utils.env_loadercontains theEnvLoaderclass which can be used to load environmental variables, specifically the IP address of the Misty robot.misty2py.utils.env_loader::EnvLoader.__init__(akamisty2py.utils.env_loader.EnvLoader()) - initialises theEnvLoader, takes optional argumentenv_path(str) for a custom path to the.envfile.misty2py.utils.env_loader::EnvLoader.get_ip- obtains the value of the environmental variableMISTY_IP_ADDRESSif set, else returnsNone.
-
misty2py.utils.generators- contains generator functions.misty2py.utils.generators::get_random_string- returns a randomncharacters long string of ASCII letters and digits
-
misty2py.utils.messages- contains message parsing methods.misty2py.utils.messages::message_parser- parses a message from misty2py json Dict reply to a string.misty2py.utils.messages::compose_str- addspotential_strtomain_strifpotential_stris notNone, else addsfallbacktomain_striffallbackis notNone, else returnsmain_str
-
misty2py.utils.utils- contains generally useful functions that do not fall into any of the above categories.misty2py.utils.utils::query_dict_with_fallback- safely queries a dictionary and if the key does not exist or the value has inappropriate type, returns the fallback value.
Keywords and shortcuts
List of supported action keywords
ledfor post request toapi/ledendpointled_transfor post request toapi/led/transitionendpointnotification_settingsfor post request toapi/notification/settingsendpointaudio_uploadfor post requestapi/audioto endpointaudio_playfor post request toapi/audio/playendpointaudio_pausefor post request toapi/audio/pauseendpointaudio_stopfor post request toapi/audio/stopendpointaudio_deletefor delete request toapi/audioendpointaudio_record_startfor post request toapi/audio/record/startendpointaudio_record_stopfor post request toapi/audio/record/stopendpointaudio_disablefor post request toapi/services/audio/disableendpointaudio_enablefor post request toapi/services/audio/enableendpointimage_uploadfor post request toapi/imagesendpointimage_showfor post request toapi/images/displayendpointimage_settingsfor post request toapi/images/settingsendpointimage_deletefor delete request toapi/imagesendpointtext_showfor post request toapi/text/displayendpointtext_settingsfor post request toapi/text/settingsendpointvideo_uploadfor post request toapi/videosendpointvideo_showfor post request toapi/videos/displayendpointvideo_settingsfor post request toapi/videos/settingsendpointvideo_deletefor delete request toapi/videosendpointblink_mapping_deletefor delete request toapi/blink/imagesendpointslam_enablefor post request toapi/services/slam/enableendpointslam_disablefor post request toapi/services/slam/disableendpointslam_sensors_resetfor post request toapi/slam/resetendpointslam_mapping_startfor post request toapi/slam/map/startendpointslam_mapping_stopfor post request toapi/slam/map/stopendpointslam_map_currentfor post request toapi/slam/map/currentendpointslam_map_renamefor post request toapi/slam/map/renameendpointslam_infrared_settingsfor post request toapi/slam/settings/irendpointslam_visible_settingsfor post request toapi/slam/settings/visibleendpointslam_map_deletefor delete request toapi/slam/mapendpointslam_docking_locate_startfor post request toapi/slam/docking/startendpointslam_docking_locate_stopfor post request toapi/slam/docking/stopendpointstreaming_slam_startfor post request toapi/slam/streaming/startendpointstreaming_slam_stopfor post request toapi/slam/streaming/stopendpointslam_track_startfor post request toapi/slam/track/startendpointslam_track_stopfor post request toapi/slam/track/stopendpointrecording_startfor post request toapi/videos/recordings/startendpointrecording_stopfor post request toapi/videos/recordings/stopendpointrecording_renamefor post request toapi/videos/recordings/renameendpointrecording_deletefor delete request toapi/videos/recordingsendpointface_detection_startfor post request toapi/faces/detection/startendpointface_detection_stopfor post request toapi/faces/detection/stopendpointface_recognition_startfor post request toapi/faces/recognition/startendpointface_recognition_stopfor post request toapi/faces/recognition/stopendpointface_train_startfor post request toapi/faces/training/startendpointface_train_cancelfor post request toapi/faces/training/cancelendpointface_deletefor delete request toapi/facesendpointskill_uploadfor post request toapi/skillsendpointskill_startfor post request toapi/skills/startendpointskills_reloadfor post request toapi/skills/reloadendpointskill_loadfor post request toapi/skills/loadendpointskill_cancelfor post request toapi/skills/cancelendpointskill_deletefor delete request toapi/skillsendpointwifi_addfor post request toapi/networks/createendpointwifi_connectfor post request toapi/networksendpointwifi_deletefor delete request toapi/networksendpointwifi_hotspot_startfor post request toapi/networks/hotspot/startendpointwifi_hotspot_stopfor post request toapi/networks/hotspot/stopendpointwrite_serialfor post request toapi/serialendpointevent_listenerfor post request toapi/skills/eventendpointwebsite_showfor post request toapi/webviews/displayendpointwebsite_settingsfor post request toapi/webviews/settingsendpointblink_onfor post request toapi/blinkendpointblink_settingsfor post request toapi/blink/settingsendpointdisplay_settingsfor post request toapi/display/settingsendpointflashlight_onfor post request toapi/flashlightendpointspeakfor post request toapi/tts/speakendpointspeak_stopfor post request toapi/tts/stopendpointspeech_capturefor post request toapi/audio/speech/captureendpointdrivefor post request toapi/driveendpointdrive_arcfor post request toapi/drive/arcendpointdrive_headingfor post request toapi/drive/hdtendpointdrive_timefor post request toapi/drive/timeendpointdrive_trackfor post request toapi/drive/trackendpointdrive_stopfor post request toapi/drive/stopendpointdrive_to_locfor post request toapi/drive/coordinatesendpointdrive_on_pathfor post request toapi/drive/pathendpointhaltfor post request toapi/haltendpointarm_movefor post request toapi/armsendpointarms_movefor post request toapi/arms/setendpointhead_movefor post request toapi/headendpointhazard_settingsfor post request toapi/hazard/updatebasesettingsendpointstreaming_av_startfor post request toapi/avstreaming/startendpointstreaming_av_stopfor post request toapi/avstreaming/stopendpointstreaming_av_disablefor post request toapi/services/avstreaming/disableendpointstreaming_av_enablefor post request toapi/services/avstreaming/enableendpointkeyphrase_recognition_startfor post request toapi/audio/keyphrase/startendpointkeyphrase_recognition_stopfor post request toapi/audio/keyphrase/stopendpointupdate_allowfor post request toapi/system/update/allowendpointupdate_performfor post request toapi/system/updateendpointupdate_perform_targetedfor post request toapi/system/update/componentendpointupdate_preventfor post request toapi/system/update/preventendpointerror_text_clearfor post request toapi/text/error/clearendpointcamera_disablefor post request toapi/services/camera/disableendpointcamera_enablefor post request toapi/services/camera/enableendpointrestartfor post request toapi/rebootendpointvolume_settingsfor post request toapi/audio/volumeendpointlogs_settingsfor post request toapi/logs/levelendpointwebsocket_settingsfor post request toapi/websocket/versionendpointexternal_requestfor post request toapi/requestendpoint
List of supported information keywords
audio_filefor get request toapi/audioendpointaudio_listfor get request toapi/audio/listendpointaudio_statusfor get request toapi/services/audioendpointimage_filefor get request toapi/imagesendpointimage_listfor get request toapi/images/listendpointvideo_filefor get request toapi/videosendpointvideo_listfor get request toapi/videos/listendpointav_statusfor get request toapi/services/avstreamingendpointsensor_valuesfor get request toapi/serialendpointmap_filefor get request toapi/slam/mapendpointcurrent_map_idfor get request toapi/slam/map/currentendpointmap_id_listfor get request toapi/slam/map/idsendpointslam_diagnosticsfor get request toapi/slam/diagnosticsendpointslam_pathfor get request toapi/slam/pathendpointslam_statusfor get request toapi/slam/statusendpointslam_enabledfor get request toapi/services/slamendpointpicture_depthfor get request toapi/cameras/depthendpointpicture_fisheyefor get request toapi/cameras/fisheyeendpointpicture_rgbfor get request toapi/cameras/rgbendpointfaces_knownfor get request toapi/facesendpointrecording_filefor get request toapi/videos/recordingsendpointrecording_listfor get request toapi/videos/recordings/listendpointskills_runningfor get request toapi/skills/runningendpointskills_knownfor get request toapi/skillsendpointwifis_availablefor get request toapi/networks/scanendpointwifis_savedfor get request toapi/networksendpointbattery_statusfor get request toapi/batteryendpointcamera_statusfor get request toapi/services/cameraendpointblink_settingsfor get request toapi/blink/settingsendpointhazards_settingsfor get request toapi/hazards/settingsendpointcamera_settingsfor get request toapi/cameraendpointslam_visible_settingsfor get request toapi/slam/settings/visibleendpointslam_infrared_settingsfor get request toapi/slam/settings/irendpointupdate_settingsfor get request toapi/system/update/settingsendpointdevicefor get request toapi/deviceendpointhelpfor get request toapi/helpendpointlogfor get request toapi/logsendpointlog_levelfor get request toapi/logs/levelendpointupdate_availablefor get request toapi/system/updatesendpointwebsocketsfor get request toapi/websocketsendpointwebsocket_versionfor get request toapi/websocket/version
List of supported data shortcuts
led_offfor{ "red": "0", "green": "0", "blue": "0" }white_lightfor{ "red": "255", "green": "255", "blue": "255" }red_lightfor{ "red": "255", "green": "0", "blue": "0" }green_lightfor{ "red": "0", "green": "255", "blue": "0" }blue_lightfor{ "red": "0", "green": "0", "blue": "255" }yellow_lightfor{ "red": "255", "green": "255", "blue": "0" }cyan_lightfor{ "red": "0", "green": "255", "blue": "255" }magenta_lightfor{ "red": "255", "green": "0", "blue": "255" }orange_lightfor{ "red": "255", "green": "125", "blue": "0" }lime_lightfor{ "red": "125", "green": "255", "blue": "0" }aqua_lightfor{ "red": "0", "green": "255", "blue": "125" }azure_lightfor{ "red": "0", "green": "125", "blue": "255" }violet_lightfor{ "red": "125", "green": "0", "blue": "255" }pink_lightfor{ "red": "255", "green": "0", "blue": "125" }low_volumefor{ "Volume": "5" }image_admirationfor{"FileName": "e_Admiration.jpg"}image_aggressivenessfor{"FileName": "e_Aggressiveness.jpg"}image_amazementfor{"FileName": "e_Amazement.jpg"}image_angerfor{"FileName": "e_Anger.jpg"}image_concernedfor{"FileName": "e_ApprehensionConcerned.jpg"}image_contemptfor{"FileName": "e_Contempt.jpg"}image_content_leftfor{"FileName": "e_ContentLeft.jpg"}image_content_rightfor{"FileName": "e_ContentRight.jpg"}image_content_defaultfor{"FileName": "e_DefaultContent.jpg"}image_disgustfor{"FileName": "e_Disgust.jpg"}image_disorientedfor{"FileName": "e_Disoriented.jpg"}image_hilariousfor{"FileName": "e_EcstacyHilarious.jpg"}image_starry_eyedfor{"FileName": "e_EcstacyStarryEyed.jpg"}image_fearfor{"FileName": "e_Fear.jpg"}image_grieffor{"FileName": "e_Grief.jpg"}image_joy_1for{"FileName": "e_Joy.jpg"}image_joy_2for{"FileName": "e_Joy2.jpg"}image_goofy_1for{"FileName": "e_JoyGoofy.jpg"}image_goofy_2for{"FileName": "e_JoyGoofy2.jpg"}image_goofy_3for{"FileName": "e_JoyGoofy3.jpg"}image_lovefor{"FileName": "e_Love.jpg"}image_rage_1for{"FileName": "e_Rage.jpg"}image_rage_2for{"FileName": "e_Rage2.jpg"}image_rage_3for{"FileName": "e_Rage3.jpg"}image_rage_4for{"FileName": "e_Rage4.jpg"}image_remorsefor{"FileName": "e_RemorseShame.jpg"}image_sadnessfor{"FileName": "e_Sadness.jpg"}image_sleping_1for{"FileName": "e_Sleeping.jpg"}image_sleeping_2for{"FileName": "e_SleepingZZZ.jpg"}image_sleepy_1for{"FileName": "e_Sleepy.jpg"}image_sleepy_2for{"FileName": "e_Sleepy2.jpg"}image_sleepy_3for{"FileName": "e_Sleepy3.jpg"}image_sleepy_4for{"FileName": "e_Sleepy4.jpg"}image_surprisefor{"FileName": "e_Surprise.jpg"}image_system_black_screenfor{"FileName": "e_SystemBlackScreen.jpg"}image_system_blink_largefor{"FileName": "e_SystemBlinkLarge.jpg"}image_system_blink_standardfor{"FileName": "e_SystemBlinkStandard.jpg"}image_system_camerafor{"FileName": "e_SystemCamera.jpg"}image_system_flashfor{"FileName": "e_SystemFlash.jpg"}image_system_gear_promptfor{"FileName": "e_SystemGearPrompt.jpg"}image_system_logo_promptfor{"FileName": "e_SystemLogoPrompt.jpg"}image_terror_1for{"FileName": "e_Terror.jpg"}image_terror_2for{"FileName": "e_Terror2.jpg"}image_terror_leftfor{"FileName": "e_TerrorLeft.jpg"}image_terror_rightfor{"FileName": "e_TerrorRight.jpg"}sound_acceptancefor{ "FileName": "s_Acceptance.wav" }sound_amazement_1for{ "FileName": "s_Amazement.wav" }sound_amazement_2for{ "FileName": "s_Amazement2.wav" }sound_anger_1for{ "FileName": "s_Anger.wav" }sound_anger_2for{ "FileName": "s_Anger2.wav" }sound_anger_3for{ "FileName": "s_Anger3.wav" }sound_anger_4for{ "FileName": "s_Anger4.wav" }sound_annoyance_1for{ "FileName": "s_Annoyance.wav" }sound_annoyance_2for{ "FileName": "s_Annoyance2.wav" }sound_annoyance_3for{ "FileName": "s_Annoyance3.wav" }sound_annoyance_4for{ "FileName": "s_Annoyance4.wav" }sound_awe_1for{ "FileName": "s_Awe.wav" }sound_awe_2for{ "FileName": "s_Awe2.wav" }sound_awe_3for{ "FileName": "s_Awe3.wav" }sound_boredomfor{ "FileName": "s_Boredom.wav" }sound_disapprovalfor{ "FileName": "s_Disapproval.wav" }sound_disgust_1for{ "FileName": "s_Disgust.wav" }sound_disgust_2for{ "FileName": "s_Disgust2.wav" }sound_disgust_3for{ "FileName": "s_Disgust3.wav" }sound_disoriented_1for{ "FileName": "s_DisorientedConfused.wav" }sound_disoriented_2for{ "FileName": "s_DisorientedConfused2.wav" }sound_disoriented_3for{ "FileName": "s_DisorientedConfused3.wav" }sound_disoriented_4for{ "FileName": "s_DisorientedConfused4.wav" }sound_disoriented_5for{ "FileName": "s_DisorientedConfused5.wav" }sound_disoriented_6for{ "FileName": "s_DisorientedConfused6.wav" }sound_distractionfor{ "FileName": "s_Distraction.wav" }sound_ecstacy_1for{ "FileName": "s_Ecstacy.wav" }sound_ecstacy_2for{ "FileName": "s_Ecstacy2.wav" }sound_fearfor{ "FileName": "s_Fear.wav" }sound_grief_1for{ "FileName": "s_Grief.wav" }sound_grief_2for{ "FileName": "s_Grief2.wav" }sound_grief_3for{ "FileName": "s_Grief3.wav" }sound_grief_4for{ "FileName": "s_Grief4.wav" }sound_joy_1for{ "FileName": "s_Joy.wav" }sound_joy_2for{ "FileName": "s_Joy2.wav" }sound_joy_3for{ "FileName": "s_Joy3.wav" }sound_joy_4for{ "FileName": "s_Joy4.wav" }sound_loathingfor{ "FileName": "s_Loathing.wav" }sound_lovefor{ "FileName": "s_Love.wav" }sound_phrase_bye_byefor{ "FileName": "s_PhraseByeBye.wav" }sound_phrase_evilfor{ "FileName": "s_PhraseEvilAhHa.wav" }sound_phrase_hellofor{ "FileName": "s_PhraseHello.wav" }sound_phrase_nofor{ "FileName": "s_PhraseNoNoNo.wav" }sound_phrase_oopsyfor{ "FileName": "s_PhraseOopsy.wav" }sound_phrase_owfor{ "FileName": "s_PhraseOwOwOw.wav" }sound_phrase_owwfor{ "FileName": "s_PhraseOwwww.wav" }sound_phrase_uhfor{ "FileName": "s_PhraseUhOh.wav" }sound_ragefor{ "FileName": "s_Rage.wav" }sound_sadness_1for{ "FileName": "s_Sadness.wav" }sound_sadness_2for{ "FileName": "s_Sadness2.wav" }sound_sadness_3for{ "FileName": "s_Sadness3.wav" }sound_sadness_4for{ "FileName": "s_Sadness4.wav" }sound_sadness_5for{ "FileName": "s_Sadness5.wav" }sound_sadness_6for{ "FileName": "s_Sadness6.wav" }sound_sadness_7for{ "FileName": "s_Sadness7.wav" }sound_sleepy_1for{ "FileName": "s_Sleepy.wav" }sound_sleepy_2for{ "FileName": "s_Sleepy2.wav" }sound_sleepy_3for{ "FileName": "s_Sleepy3.wav" }sound_sleepy_4for{ "FileName": "s_Sleepy4.wav" }sound_sleepy_snorefor{ "FileName": "s_SleepySnore.wav" }sound_camera_shutterfor{ "FileName": "s_SystemCameraShutter.wav" }sound_failurefor{ "FileName": "s_SystemFailure.wav" }sound_successfor{ "FileName": "s_SystemSuccess.wav" }sound_wakefor{ "FileName": "s_SystemWakeWord.wav" }
Adding custom keywords and shortcuts
Custom keywords and shortcuts can be passed to a Misty object while declaring a new instance by using the optional arguments:
custom_infofor custom information keywords (a dictionary with keys being the information keywords and values being the endpoints),custom_actionsfor custom action keywords (a dictionary with keys being the action keywords and values being a dictionary{"endpoint" : "edpoint_value", "method" : "method_value"}wheremethod_valueis eitherpostordelete),custom_datafor custom data shortcuts (a dictionary with keys being the data shortcuts and values being the dictionary of data values).
An example:
custom_allowed_infos = {
"hazards_settings": "api/hazards/settings"
}
custom_allowed_data = {
"amazement": {
"FileName": "s_Amazement.wav"
},
"red": {
"red": "255",
"green": "0",
"blue": "0"
}
}
custom_allowed_actions = {
"audio_play" : {
"endpoint" : "api/audio/play",
"method" : "post"
},
"delete_audio" : {
"endpoint" : "api/audio",
"method" : "delete"
}
}
misty_robot = Misty("0.0.0.0",
custom_info=custom_allowed_infos,
custom_actions=custom_allowed_actions,
custom_data=custom_allowed_data)
Running Misty2py from source
-
If this is your first time using
misty2pyfrom source, do following:- Copy
.env.exampleto.env. - Replace the placeholder values in the new
.envfile. - Run
poetry installto obtain all dependencies.
- Copy
-
Run the desired script via
poetry run python -m [name]where[name]is the placeholder for the module location (in Python notation). -
If the scripts run but your Misty does not seem to respond, you have most likely provided an incorrect IP address for
MISTY_IP_ADDRESSin.env.
Pytests
This repository contains several parametrised unit tests under the pytest library that can be found in the directory tests. The test coverage is currently 84%.
Instructions for running the tests and test coverage reports
-
if this is your first time using misty2py from source, follow instructions in Running Misty2py from source.
-
Pytests can be run via
poetry run pytest .. -
The coverage report can be obtained via
poetry run pytest --cov-report html --cov=misty2py testsfor HTML output or viapoetry run pytest --cov=misty2py testsfor terminal output.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file misty2py-4.1.3.tar.gz.
File metadata
- Download URL: misty2py-4.1.3.tar.gz
- Upload date:
- Size: 31.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.2 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2dc6986c174465f160f5c0bb46b39ef12c22ab4bdfe5a197ab581467f5ed910
|
|
| MD5 |
e94215e680acb9e2e77e9e137cb7a523
|
|
| BLAKE2b-256 |
0f58a0b4f8d123518532dc7ab50fd0ec600204437c2591c10b526bc0888da85e
|
File details
Details for the file misty2py-4.1.3-py3-none-any.whl.
File metadata
- Download URL: misty2py-4.1.3-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.2 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
607c8a2891390e23cd7b2d85d59901b49f4eeb18eb70b9ea7c9e8be7f19117e1
|
|
| MD5 |
f2ce61f1097c7402a2d29d10c422551e
|
|
| BLAKE2b-256 |
f4cc770a8b81b07781e5a7bc90893619c6aefd6cc890e0e37bb133d8241e1717
|