Print base64 RF learned command output (#286)
* Print base64 RF learned command output Would be helpful for hassio fans, they can easily copy paste the output into their automation configuration file. * Update broadlink_cli
This commit is contained in:
		
							parent
							
								
									56e444cacf
								
							
						
					
					
						commit
						cbb1d67df8
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -225,6 +225,8 @@ if args.rfscanlearn:
 | 
				
			||||||
            else ''.join(format(x, '02x') for x in bytearray(data))
 | 
					            else ''.join(format(x, '02x') for x in bytearray(data))
 | 
				
			||||||
        if args.learnfile is None:
 | 
					        if args.learnfile is None:
 | 
				
			||||||
            print(learned)
 | 
					            print(learned)
 | 
				
			||||||
 | 
					            decode_hex = codecs.getdecoder("hex_codec")
 | 
				
			||||||
 | 
					            print("Base64: {}".format(str(base64.b64encode(decode_hex(learned)[0])).decode('utf8')))
 | 
				
			||||||
        if args.learnfile is not None:
 | 
					        if args.learnfile is not None:
 | 
				
			||||||
            print("Saving to {}".format(args.learnfile))
 | 
					            print("Saving to {}".format(args.learnfile))
 | 
				
			||||||
            with open(args.learnfile, "w") as text_file:
 | 
					            with open(args.learnfile, "w") as text_file:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue