Rename ocr.png to ssocr-(entity_name).png to allow multiple instances (#18634)

* * Rename ocr.png to ssocr-(entity_name).png to allow multiple seven_segments instances to run without overwrting each other's data.

* Update seven_segments.py

* Update seven_segments.py

* Use string formatting
This commit is contained in:
jumpkick 2018-12-20 11:31:58 -05:00 committed by Charles Garwood
parent d42d8543c8
commit dcf925a67f

View File

@ -69,7 +69,9 @@ class ImageProcessingSsocr(ImageProcessingEntity):
split_entity_id(camera_entity)[1])
self._state = None
self.filepath = os.path.join(self.hass.config.config_dir, 'ocr.png')
self.filepath = os.path.join(self.hass.config.config_dir,
'ssocr-{0}.png'.format(
self._name.replace(' ', '_')))
crop = ['crop', str(config[CONF_X_POS]), str(config[CONF_Y_POS]),
str(config[CONF_WIDTH]), str(config[CONF_HEIGHT])]
digits = ['-d', str(config.get(CONF_DIGITS, -1))]