1010import homeassistant .helpers .config_validation as cv
1111from homeassistant .helpers .event import track_time_interval
1212
13- __version__ = '3.0 .0'
13+ __version__ = '3.1 .0'
1414
1515_LOGGER = logging .getLogger (__name__ )
1616
17- REQUIREMENTS = ['pyupdate==0.0.19 ' ]
17+ REQUIREMENTS = ['pyupdate==0.1.2 ' ]
1818
1919CONF_TRACK = 'track'
2020CONF_HIDE_SENSOR = 'hide_sensor'
@@ -103,6 +103,7 @@ def install_service(call):
103103 _LOGGER .debug ('Installing %s' , element )
104104 card_controller .install (element )
105105 components_controller .install (element )
106+ python_scripts_controller .install (element )
106107
107108 hass .services .register (DOMAIN , 'check_all' , check_all_service )
108109 hass .services .register (DOMAIN , 'update_all' , update_all_service )
@@ -129,9 +130,11 @@ def __init__(self, hass, conf_hide_sensor, conf_card_urls,
129130 self .show_installable = config_show_installable
130131 self .cache_versions ()
131132
133+
132134 def cache_versions (self ):
133135 """Cache."""
134136 information = self .pyupdate .get_sensor_data (self .ha_conf_dir ,
137+ self .show_installable ,
135138 self .custom_url )
136139 self .hass .states .set ('sensor.custom_card_tracker' , information [1 ],
137140 information [0 ])
@@ -140,10 +143,12 @@ def update_all(self):
140143 """Update all cards."""
141144 self .pyupdate .update_all (self .ha_conf_dir , self .custom_url )
142145 information = self .pyupdate .get_sensor_data (self .ha_conf_dir ,
146+ self .show_installable ,
143147 self .custom_url )
144148 self .hass .states .set ('sensor.custom_card_tracker' , information [1 ],
145149 information [0 ])
146150
151+
147152 def install (self , element ):
148153 """Install single card."""
149154 self .pyupdate .install (self .ha_conf_dir , element , self .custom_url )
@@ -152,8 +157,6 @@ def install(self, element):
152157class CustomComponents ():
153158 """Custom components controller."""
154159
155- # pylint: disable=too-many-instance-attributes
156-
157160 def __init__ (self , hass , conf_hide_sensor , conf_component_urls ,
158161 config_show_installable ):
159162 """Initialize."""
@@ -168,29 +171,29 @@ def __init__(self, hass, conf_hide_sensor, conf_component_urls,
168171 self .show_installable = config_show_installable
169172 self .cache_versions ()
170173
174+
171175 def cache_versions (self ):
172176 """Cache."""
173- information = self .pyupdate .get_sensor_data (self .custom_url )
177+ information = self .pyupdate .get_sensor_data (self .show_installable ,
178+ self .custom_url )
174179 self .hass .states .set ('sensor.custom_component_tracker' , information [1 ],
175180 information [0 ])
176181
177182 def update_all (self ):
178183 """Update all components."""
179184 self .pyupdate .update_all (self .ha_conf_dir , self .custom_url )
180- information = self .pyupdate .get_sensor_data (self .custom_url )
185+ information = self .pyupdate .get_sensor_data (self .show_installable ,
186+ self .custom_url )
181187 self .hass .states .set ('sensor.custom_component_tracker' , information [1 ],
182188 information [0 ])
183189
184190 def install (self , element ):
185191 """Install single component."""
186192 self .pyupdate .install (self .ha_conf_dir , element , self .custom_url )
187193
188-
189194class CustomPythonScripts ():
190195 """Custom python_scripts controller."""
191196
192- # pylint: disable=too-many-instance-attributes
193-
194197 def __init__ (self , hass , conf_hide_sensor , conf_python_script_urls ,
195198 config_show_installable ):
196199 """Initialize."""
@@ -205,17 +208,20 @@ def __init__(self, hass, conf_hide_sensor, conf_python_script_urls,
205208 self .show_installable = config_show_installable
206209 self .cache_versions ()
207210
211+
208212 def cache_versions (self ):
209213 """Cache."""
210- information = self .pyupdate .get_sensor_data (self .custom_url )
214+ information = self .pyupdate .get_sensor_data (self .show_installable ,
215+ self .custom_url )
211216 self .hass .states .set ('sensor.custom_python_script_tracker' ,
212217 information [1 ],
213218 information [0 ])
214219
215220 def update_all (self ):
216221 """Update all python_scripts."""
217222 self .pyupdate .update_all (self .ha_conf_dir , self .custom_url )
218- information = self .pyupdate .get_sensor_data (self .custom_url )
223+ information = self .pyupdate .get_sensor_data (self .show_installable ,
224+ self .custom_url )
219225 self .hass .states .set ('sensor.custom_python_script_tracker' ,
220226 information [1 ],
221227 information [0 ])
0 commit comments