This repository was archived by the owner on Jan 18, 2021. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 1515import  homeassistant .helpers .config_validation  as  cv 
1616from  homeassistant .helpers .event  import  track_time_interval 
1717
18- __version__  =  '1.4.0 ' 
18+ __version__  =  '1.4.1 ' 
1919
2020_LOGGER  =  logging .getLogger (__name__ )
2121
@@ -234,13 +234,20 @@ def get_local_version(self, card):
234234        cardconfig  =  '' 
235235        if  self ._lovelace_gen :
236236            conf_file  =  self .ha_conf_dir  +  '/lovelace/main.yaml' 
237+             with  open (conf_file , 'r' ) as  local :
238+                 for  line  in  local .readlines ():
239+                     if  card  +  '.js'  in  line :
240+                         cardconfig  =  line 
241+                         break 
242+             local .close ()
237243        else :
238244            conf_file  =  self .ha_conf_dir  +  '/ui-lovelace.yaml' 
239-         with  open (conf_file , 'r' ) as  local :
240-             for  line  in  local .readlines ():
241-                 if  card  +  '.js'  in  line :
242-                     cardconfig  =  line 
243-                     break 
245+             with  open (conf_file , 'r' ) as  local :
246+                 for  line  in  local .readlines ():
247+                     if  '/'  +  card  +  '.js'  in  line :
248+                         cardconfig  =  line 
249+                         break 
250+             local .close ()
244251        if  '='  in  cardconfig :
245252            localversion  =  cardconfig .split ('=' )[1 ].split ('\n ' )[0 ]
246253            _LOGGER .debug ('Local version of %s is %s' , card , localversion )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments