Skip to content

Commit

Permalink
Change variable/configuration names to the correct term (#14)
Browse files Browse the repository at this point in the history
Change variable/configuration names to the correct term
  • Loading branch information
ljmerza authored Sep 11, 2019
2 parents 6bf2bc6 + b8759b4 commit 44557e6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Home Assistant Email Sensor

Gets emails from SMTP and prases out any tracking numbers from FedEx, UPS, USPS, Rockauto, Newegg, B&H Photo, Paypal, eBay, DHL, Philips Hue, Google Express, and Ali Express. Goes well with the [tracking-number-card](https://github.com/ljmerza/tracking-number-card) for lovelace!
Gets emails from IMAP and prases out any tracking numbers from FedEx, UPS, USPS, Rockauto, Newegg, B&H Photo, Paypal, eBay, DHL, Philips Hue, Google Express, and Ali Express. Goes well with the [tracking-number-card](https://github.com/ljmerza/tracking-number-card) for lovelace!

---

Expand Down Expand Up @@ -31,8 +31,8 @@ sensor:
| ---- | ---- | ------- | -----------
| email | string | **Required** | email address
| password | string | **Required** | email password
| smtp_server | string | **Optional** | `imap.gmail.com` SMTP server address>
| smtp_port | number | **Optional** | `993` SMTP port
| imap_server | string | **Optional** | `imap.gmail.com` IMAP server address>
| imap_port | number | **Optional** | `993` IMAP port
| folder | string | **Optional** | `INBOX` Which folder to pull emails from
| show_all | boolean | **Optional** | `false` Show only unseen emails (default) or all emails from `folder`

Expand Down
4 changes: 2 additions & 2 deletions custom_components/email/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

CONF_EMAIL = 'email'
CONF_PASSWORD = 'password'
CONF_SMTP_SERVER = 'smtp_server'
CONF_SMTP_PORT = 'smpt_port'
CONF_IMAP_SERVER = 'imap_server'
CONF_IMAP_PORT = 'imap_port'
CONF_EMAIL_FOLDER = 'folder'
CONF_SHOW_ALL = 'show_all'

Expand Down
14 changes: 7 additions & 7 deletions custom_components/email/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from homeassistant.helpers.entity import Entity

from .const import (
CONF_EMAIL, CONF_PASSWORD, CONF_SHOW_ALL, CONF_SMTP_SERVER,
CONF_SMTP_PORT, CONF_EMAIL_FOLDER, ATTR_EMAILS, ATTR_COUNT,
CONF_EMAIL, CONF_PASSWORD, CONF_SHOW_ALL, CONF_IMAP_SERVER,
CONF_IMAP_PORT, CONF_EMAIL_FOLDER, ATTR_EMAILS, ATTR_COUNT,
ATTR_TRACKING_NUMBERS, EMAIL_ATTR_FROM, EMAIL_ATTR_SUBJECT,
EMAIL_ATTR_BODY)

Expand Down Expand Up @@ -50,8 +50,8 @@
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_EMAIL): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_SMTP_SERVER, default='imap.gmail.com'): cv.string,
vol.Required(CONF_SMTP_PORT, default=993): cv.positive_int,
vol.Required(CONF_IMAP_SERVER, default='imap.gmail.com'): cv.string,
vol.Required(CONF_IMAP_PORT, default=993): cv.positive_int,
vol.Required(CONF_EMAIL_FOLDER, default='INBOX'): cv.string,
vol.Required(CONF_SHOW_ALL, default=False): cv.boolean,
})
Expand All @@ -69,8 +69,8 @@ def __init__(self, config):
"""Init the Email Entity."""
self._attr = None

self.smtp_server = config[CONF_SMTP_SERVER]
self.smtp_port = config[CONF_SMTP_PORT]
self.imap_server = config[CONF_IMAP_SERVER]
self.imap_port = config[CONF_IMAP_PORT]
self.email_address = config[CONF_EMAIL]
self.password = config[CONF_PASSWORD]
self.email_folder = config[CONF_EMAIL_FOLDER]
Expand All @@ -84,7 +84,7 @@ def update(self):
ATTR_TRACKING_NUMBERS: {}
}
emails = []
server = IMAPClient(self.smtp_server, use_uid=True)
server = IMAPClient(self.imap_server, use_uid=True)

try:
server.login(self.email_address, self.password)
Expand Down
6 changes: 3 additions & 3 deletions info.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Home Assistant Email Sensor

Gets emails from SMTP and prases out any tracking numbers from FedEx, UPS, USPS, Rockauto, Newegg, B&H Photo, Paypal, eBay, DHL, Philips Hue, Google Express, and Ali Express. Goes well with the [tracking-number-card](https://github.com/ljmerza/tracking-number-card) for lovelace!
Gets emails from IMAP and prases out any tracking numbers from FedEx, UPS, USPS, Rockauto, Newegg, B&H Photo, Paypal, eBay, DHL, Philips Hue, Google Express, and Ali Express. Goes well with the [tracking-number-card](https://github.com/ljmerza/tracking-number-card) for lovelace!

---

Expand Down Expand Up @@ -31,8 +31,8 @@ sensor:
| ---- | ---- | ------- | -----------
| email | string | **Required** | email address
| password | string | **Required** | email password
| smtp_server | string | **Optional** | `imap.gmail.com` SMTP server address>
| smtp_port | number | **Optional** | `993` SMTP port
| imap_server | string | **Optional** | `imap.gmail.com` IMAP server address>
| imap_port | number | **Optional** | `993` IMAP port
| folder | string | **Optional** | `INBOX` Which folder to pull emails from
| show_all | boolean | **Optional** | `false` Show only unseen emails (default) or all emails from `folder`

Expand Down

0 comments on commit 44557e6

Please sign in to comment.