File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,16 @@ def were_pressed(self):
4949                ret .add (button )
5050        return  ret 
5151
52+     @property  
53+     def  button_a (self ):
54+         """``True`` when Button A is pressed. ``False`` if not.""" 
55+         return  not  self ._a .value 
56+ 
57+     @property  
58+     def  button_b (self ):
59+         """``True`` when Button B is pressed. ``False`` if not.""" 
60+         return  not  self ._b .value 
61+ 
5262    def  _touch (self , i ):
5363        if  not  isinstance (self ._touches [i ], touchio .TouchIn ):
5464            self ._touches [i ] =  touchio .TouchIn (self ._touches [i ])
@@ -549,12 +559,12 @@ def ams_remote(self):
549559                time .sleep (0.25 )
550560
551561            # If button B (on the right) is pressed, it increases the volume 
552-             if  'B'   in   self .clue .were_pressed :
562+             if  self .clue .button_b :
553563                self .ams .volume_up ()
554564                time .sleep (0.1 )
555565
556566            # If button A (on the left) is pressed, the volume decreases 
557-             if  'A'   in   self .clue .were_pressed :
567+             if  self .clue .button_a :
558568                self .ams .volume_down ()
559569                time .sleep (0.1 )
560570        except  (RuntimeError , UnsupportedCommand , AttributeError ):
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments