mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Check if /dev/input/by-id exists (#8601)
This commit is contained in:
parent
3fec2955a5
commit
1831a7da68
@ -94,20 +94,25 @@ class KeyboardRemote(threading.Thread):
|
|||||||
if self.dev is not None:
|
if self.dev is not None:
|
||||||
_LOGGER.debug("Keyboard connected, %s", self.device_id)
|
_LOGGER.debug("Keyboard connected, %s", self.device_id)
|
||||||
else:
|
else:
|
||||||
id_folder = '/dev/input/by-id/'
|
|
||||||
device_names = [InputDevice(file_name).name
|
|
||||||
for file_name in list_devices()]
|
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
'Keyboard not connected, %s.\n\
|
'Keyboard not connected, %s.\n\
|
||||||
Check /dev/input/event* permissions.\
|
Check /dev/input/event* permissions.',
|
||||||
Possible device names are:\n %s.\n \
|
self.device_id
|
||||||
Possible device descriptors are %s:\n %s',
|
|
||||||
self.device_id,
|
|
||||||
device_names,
|
|
||||||
id_folder,
|
|
||||||
os.listdir(id_folder)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
id_folder = '/dev/input/by-id/'
|
||||||
|
|
||||||
|
if os.path.isdir(id_folder):
|
||||||
|
device_names = [InputDevice(file_name).name
|
||||||
|
for file_name in list_devices()]
|
||||||
|
_LOGGER.debug(
|
||||||
|
'Possible device names are:\n %s.\n \
|
||||||
|
Possible device descriptors are %s:\n %s',
|
||||||
|
device_names,
|
||||||
|
id_folder,
|
||||||
|
os.listdir(id_folder)
|
||||||
|
)
|
||||||
|
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
self.stopped = threading.Event()
|
self.stopped = threading.Event()
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user