Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3bca66e
add dominos service
craigjmidwinter Oct 20, 2017
b4c34c2
change require
craigjmidwinter Oct 26, 2017
6a3813b
Merge branch 'dev' of https://github.com/home-assistant/home-assistan…
craigjmidwinter Oct 30, 2017
4faf97d
dump to log
craigjmidwinter Nov 3, 2017
64adc01
component fixes
craigjmidwinter Nov 4, 2017
27d63a9
clean-up use updated library
craigjmidwinter Nov 4, 2017
b536647
remove unnecessary import
craigjmidwinter Nov 4, 2017
18bbbca
fix hound errors
craigjmidwinter Nov 5, 2017
2793808
more lint fixes
craigjmidwinter Nov 5, 2017
a1ba981
Coverage rc
craigjmidwinter Nov 5, 2017
2b9749f
Merge branch 'dev' of https://github.com/home-assistant/home-assistan…
craigjmidwinter Nov 5, 2017
456a1c4
update requirements
craigjmidwinter Nov 5, 2017
fe574e6
cleanup as per notes
craigjmidwinter Nov 7, 2017
03ad3ac
missing message
craigjmidwinter Nov 7, 2017
646cebc
linting...
craigjmidwinter Nov 7, 2017
c5f70d2
schema validation and reducing requests
craigjmidwinter Nov 7, 2017
fd90800
Merge branch 'dev' of https://github.com/home-assistant/home-assistan…
craigjmidwinter Nov 7, 2017
c59fe34
fixlint
craigjmidwinter Nov 7, 2017
bd1f914
spacing
craigjmidwinter Nov 7, 2017
7838ceb
unused variable
craigjmidwinter Nov 7, 2017
f0d70ae
fix docstrings
craigjmidwinter Nov 7, 2017
a6c0ca6
update req
craigjmidwinter Nov 8, 2017
cffcd13
notes updates, pypi package, front-end panel
craigjmidwinter Nov 12, 2017
53f4acc
stale import
craigjmidwinter Nov 12, 2017
33e6062
fix constant name
craigjmidwinter Nov 12, 2017
db75ffb
docstrings
craigjmidwinter Nov 12, 2017
ca1a115
fix library import
craigjmidwinter Nov 12, 2017
28542ae
lint fixes
craigjmidwinter Nov 12, 2017
3172f43
pylint bug
craigjmidwinter Nov 12, 2017
fc9808d
remove built-in panel
craigjmidwinter Nov 15, 2017
810a248
Make synchronous
craigjmidwinter Nov 16, 2017
6c049cb
unused import and use throttle
craigjmidwinter Nov 16, 2017
b9815f1
Handle exceptions properly and update client
craigjmidwinter Nov 16, 2017
483934d
Import exceptions properly
craigjmidwinter Nov 16, 2017
81f7d10
unused import
craigjmidwinter Nov 16, 2017
0c1c81e
remove bloat from start-up, readability fixes from notes, retrieve me…
craigjmidwinter Nov 24, 2017
c91b719
whitespace on blank line
craigjmidwinter Nov 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change require
  • Loading branch information
craigjmidwinter committed Oct 26, 2017
commit b4c34c2b96ce68221f640accf0e2b11cb9ec1eb5
15 changes: 7 additions & 8 deletions homeassistant/components/dominos.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
ATTR_DUMP_MENU = 'dump_menu'
ATTR_ORDER_ENTITY = 'order_entity_id'

DEFAULT_NAME = 'World'

REQUIREMENTS = ['pizzapi', 'jsonpickle']
COMMIT = 'ae140bd640d64ce5fdb638d5b11cfc8dae6c6587'
REQUIREMENTS = ['https://github.com/wardcraigj/pizzapi/archive/%s.zip#pizzapi==0.0.2' % COMMIT, 'jsonpickle']

CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
Expand All @@ -41,15 +40,15 @@

def setup(hass, config):
"""Set up is called when Home Assistant is loading our component."""
dominos = Dominos(hass, config)


# if config[DOMAIN].get(ATTR_DUMP_MENU):
# hass.states.set('dominos.closest_menu', jsonpickle.encode(store.get_menu()))
if config[DOMAIN].get(ATTR_DUMP_MENU):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a config option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, no problem. Would it be preferable to perform this dump via a service call?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'ATTR_DUMP_MENU'

hass.states.set('dominos.closest_menu', jsonpickle.encode(dominos.store.get_menu()))

for order in config[DOMAIN].get(ATTR_ORDERS):
# _LOGGER.INFO('Creating Order')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

hass.states.set('dominos.' + order['name'].replace(" ", "_"), json.dumps(order['codes']))
hass.services.register(DOMAIN, 'order', Dominos(hass, config)._handle_order)
hass.services.register(DOMAIN, 'order', dominos.handle_order)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a schema for validating the service data.



# Return boolean to indicate that initialization was successfully.
Expand All @@ -65,7 +64,7 @@ def __init__(self, hass, config):
self.store = self.address.closest_store()
self.country = config[DOMAIN].get(ATTR_COUNTRY)

def _handle_order(self, call=None):
def handle_order(self, call=None):
"""Handle ordering pizza."""

order_key = call.data.get(ATTR_ORDER_ENTITY)
Expand Down