Servod: Updating servo_server.py to fix the keypress value issue

In keyboard.xml, 'map="keypress_duration"' restrict the key press control to
just the 'tab', 'press', and 'long_press' settings. This creates the problem
for the 'press' value triggered from Autotest like 'dut-control power_key:0.5'
& 'dut-control ctrl_d:0.1'.

And autotests are failing with error "Map keypress_duration doesn't contain
key \nTry one of -> 'press', 'long_press', 'tab'".

So adding new params in map (tab="0.1" & short_press="0.2") and mapping them
to the keys when autotest calling keypress without passing any values
(eg. self.servo.ctrl_d()).

And also added the try-except block in resolve_val to pass the ValueError
for the proper logging of error message at the end.

BUG=b:113756713
Branch=None
TEST=Verified firmware_FMap.dev & firmware_ECPowerButton tests on
Octopus-Yorp board, tests are passing. And also verified the following key
press events.
dut-control power_key_val:0.5
dut-control power_key:tab
dut-control power_key:press
dut-control power_key:long_press
dut-control ctrl_d:0.1

Change-Id: I3ae3d8c672c32f980a013f42c21554807fc17d08
Signed-off-by: Lenine Ajagappane <leninex.ajagappane@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1206151
Commit-Ready: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
3 files changed