🏡 Open source home automation that puts local control and privacy first.
* Added Search Configuration to IMAP Sensor The IMAP sensor currently only counts unread emails in a folder. By exposing the IMAP search parameter, the sensor can be used to count other results: - All emails in an inbox - Emails sent from an address - Emails matching a subject - Other advanced searches, especially with vendor-specific extensions. Gmail in particular supports X-GM-RAW, which lets you use any Gmail search directly ("emails with X label older than 14 days with", etc) For my use case, I just wanted total emails in a folder, to show an "X/Y" counter for total/unread. I started work on a one-off script to throw the data in, but figured I'd try to extend Home Assistant more directly, especially since this IMAP sensor correctly handles servers that push data. This is my first Home Assistant contribution, so apologies in advance if something is out of place! It's a pretty minimal modification. * Added Server Response Checking Looks like no library exception is thrown, so check for response text before parsing out results (previous code just counts spaces, so an error actually returns a state value of 4). * IMAP Warning -> Error, Count Initializes to None IMAP search response parsing throws an error instead of a warning. Email count initializes as None instead 0. Email count is untouched in case of failure to parse response (i.e. if server is temporarily down or throwing errors, or maybe due to user updating their authentication/login/etc). Fixed line length on error so it fits under 80 characters. * Fixed Indent on Logger Error Sorry about the churn! Python is pretty far from my daily-use language. (I did run this one through pep8, at least) |
||
---|---|---|
.github | ||
docs | ||
homeassistant | ||
script | ||
tests | ||
virtualization | ||
.coveragerc | ||
.dockerignore | ||
.gitattributes | ||
.gitignore | ||
.hound.yml | ||
.ignore | ||
.readthedocs.yml | ||
.travis.yml | ||
CLA.md | ||
CODE_OF_CONDUCT.md | ||
CODEOWNERS | ||
CONTRIBUTING.md | ||
Dockerfile | ||
LICENSE.md | ||
MANIFEST.in | ||
mypy.ini | ||
pylintrc | ||
README.rst | ||
requirements_all.txt | ||
requirements_docs.txt | ||
requirements_test.txt | ||
requirements_test_all.txt | ||
setup.cfg | ||
setup.py | ||
tox.ini |
Home Assistant |Build Status| |Coverage Status| |Chat Status| ================================================================================= Home Assistant is a home automation platform running on Python 3. It is able to track and control all devices at home and offer a platform for automating control. To get started: .. code:: bash python3 -m pip install homeassistant hass --open-ui Check out `home-assistant.io <https://home-assistant.io>`__ for `a demo <https://home-assistant.io/demo/>`__, `installation instructions <https://home-assistant.io/getting-started/>`__, `tutorials <https://home-assistant.io/getting-started/automation-2/>`__ and `documentation <https://home-assistant.io/docs/>`__. |screenshot-states| Featured integrations --------------------- |screenshot-components| The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://developers.home-assistant.io/docs/en/architecture_index.html>`__ and the `section on creating your own components <https://developers.home-assistant.io/docs/en/creating_component_index.html>`__. If you run into issues while using Home Assistant or during development of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information. .. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=master :target: https://travis-ci.org/home-assistant/home-assistant .. |Coverage Status| image:: https://img.shields.io/coveralls/home-assistant/home-assistant.svg :target: https://coveralls.io/r/home-assistant/home-assistant?branch=master .. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg :target: https://discord.gg/c5DvZ4e .. |screenshot-states| image:: https://raw.github.com/home-assistant/home-assistant/master/docs/screenshots.png :target: https://home-assistant.io/demo/ .. |screenshot-components| image:: https://raw.github.com/home-assistant/home-assistant/dev/docs/screenshot-components.png :target: https://home-assistant.io/components/