From bd85c2bdd210ab25e871fda0d2c8af7aa77674a3 Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Fri, 22 Sep 2017 19:35:16 +0300 Subject: [PATCH] Cosmetics --- pylgbst/constants.py | 4 ++-- pylgbst/peripherals.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pylgbst/constants.py b/pylgbst/constants.py index 1a18413..4742856 100644 --- a/pylgbst/constants.py +++ b/pylgbst/constants.py @@ -42,13 +42,13 @@ MSG_SENSOR_DATA = 0x45 MSG_SENSOR_SUBSCRIBE_ACK = 0x47 # DEVICE TYPES -DEV_AMPERAGE = 0x15 # one of them is button? onboard temperature? maybe another kind of voltage, they have same params DEV_VOLTAGE = 0x14 +DEV_AMPERAGE = 0x15 +DEV_LED = 0x17 DEV_DCS = 0x25 DEV_IMOTOR = 0x26 DEV_MOTOR = 0x27 DEV_TILT_SENSOR = 0x28 -DEV_LED = 0x17 DEVICE_TYPES = { DEV_DCS: "DISTANCE_COLOR_SENSOR", diff --git a/pylgbst/peripherals.py b/pylgbst/peripherals.py index 8adc9e8..4af5b30 100644 --- a/pylgbst/peripherals.py +++ b/pylgbst/peripherals.py @@ -170,7 +170,7 @@ class EncodedMotor(Peripheral): log.warning("Speed cannot be more than 1") relative = 1 - absolute = round(relative * 100) + absolute = round(relative * 100) # scale of 100 is proven by experiments if absolute < 0: absolute += 255 return int(absolute)