As a solution to component such as USPS, UPS, and FEDEX breaking or creating connection issues (USPS). I have had a script cobbled together to watch an email inbox for UPS, USPS, and FEDEX notifications emails and then MQTT the information to HASS to track the number of mail pieces and packages to expect.
There are other solution that do similar things with added software outside of HASS. I wanted to have something that is all contained inside HASS for the normal user. I have been, through trial and error, attempting to transform this into a platform instead of an external script. I have everything working except importing settings from the configuration yaml.
I would like to set up the configuration like this
mail_and_packages: host: !secret mail_host port: !secret mail_port username: !secret mail_username password: !secret mail_password folder: 'Inbox' image_output_path: !secret mail_image_output_path
These options are currently hardcoded in the sensor.py file until I can figure out how to import configuration options. I have tried to mimic how other platforms that accept configuration options are set up but I have not been successful. You can see some the attempted commented out in the file. Essential the platform create a sensor for each delivery service and each state checking for the services email address and associates subject.
Any help would be appreciated to guide mean the right direction and even code review