File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -345,6 +345,10 @@ async def remote(self, key: str) -> None:
345
345
------
346
346
RokuError: Received an unexpected response from the Roku device.
347
347
"""
348
+ if key [:4 ] == "Lit_" :
349
+ await self .literal (key [4 :])
350
+ return
351
+
348
352
key_lower = key .lower ()
349
353
if key_lower not in VALID_REMOTE_KEYS :
350
354
msg = f"Remote key is invalid: { key } "
Original file line number Diff line number Diff line change @@ -246,6 +246,35 @@ async def test_remote_search(aresponses: ResponsesMockServer) -> None:
246
246
await roku .remote ("search" )
247
247
248
248
249
+ @pytest .mark .asyncio
250
+ async def test_remote_literal (aresponses : ResponsesMockServer ) -> None :
251
+ """Test remote literal keypress is handled correctly."""
252
+ aresponses .add (
253
+ MATCH_HOST ,
254
+ "/keypress/Lit_t" ,
255
+ "POST" ,
256
+ aresponses .Response (status = 200 ),
257
+ )
258
+
259
+ aresponses .add (
260
+ MATCH_HOST ,
261
+ "/keypress/Lit_h" ,
262
+ "POST" ,
263
+ aresponses .Response (status = 200 ),
264
+ )
265
+
266
+ aresponses .add (
267
+ MATCH_HOST ,
268
+ "/keypress/Lit_e" ,
269
+ "POST" ,
270
+ aresponses .Response (status = 200 ),
271
+ )
272
+
273
+ async with ClientSession () as session :
274
+ roku = Roku (HOST , session = session )
275
+ await roku .remote ("Lit_the" )
276
+
277
+
249
278
@pytest .mark .asyncio
250
279
async def test_search (aresponses : ResponsesMockServer ) -> None :
251
280
"""Test search is handled correctly."""
You can’t perform that action at this time.
0 commit comments