Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd Google pubsub component #20049
+124
−0
Conversation
wafflebot
bot
added
the
in progress
label
Jan 13, 2019
timvancann
added some commits
Jan 13, 2019
timvancann
force-pushed the
timvancann:google_pubsub
branch
from
b36a9cc
to
c6dd89a
Jan 13, 2019
This comment has been minimized.
This comment has been minimized.
homeassistant
commented
Jan 13, 2019
Hi @timvancann, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
homeassistant
added
cla-needed
cla-signed
and removed
cla-needed
labels
Jan 13, 2019
fabaff
reviewed
Jan 13, 2019
timvancann
force-pushed the
timvancann:google_pubsub
branch
from
2495b7d
to
31a58ca
Jan 14, 2019
timvancann
force-pushed the
timvancann:google_pubsub
branch
from
ec149de
to
e968410
Feb 1, 2019
amelchio
self-assigned this
Feb 8, 2019
amelchio
added
the
cla-recheck
label
Feb 8, 2019
homeassistant
removed
the
cla-recheck
label
Feb 8, 2019
balloob
added
cla-recheck
and removed
cla-error
cla-signed
labels
Feb 8, 2019
homeassistant
removed
the
cla-recheck
label
Feb 8, 2019
homeassistant
added
the
cla-signed
label
Feb 8, 2019
amelchio
requested changes
Feb 8, 2019
This looks really good |
_LOGGER.error("Path to credentials file cannot be found") | ||
return False | ||
|
||
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = service_principal_path |
This comment has been minimized.
This comment has been minimized.
amelchio
Feb 8, 2019
Member
Is there some way to pass this without modifying the global environment?
This comment has been minimized.
This comment has been minimized.
"""Implement encoding logic.""" | ||
if isinstance(o, datetime.datetime): | ||
return o.isoformat() | ||
return super(DateTimeJSONEncoder, self).default(o) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
amelchio
removed their assignment
Feb 8, 2019
home-assistant
deleted a comment from
homeassistant
Feb 10, 2019
MartinHjelmare
reviewed
Feb 10, 2019
"""Activate Google Pub/Sub component.""" | ||
from google.cloud import pubsub_v1 # pylint: disable=E0611 | ||
|
||
config = yaml_config.get(DOMAIN, {}) |
This comment has been minimized.
This comment has been minimized.
MartinHjelmare
Feb 10, 2019
Member
When would the DOMAIN
key be missing in the config dict? Why do we need to use dict.get
?
This comment has been minimized.
This comment has been minimized.
class DateTimeJSONEncoder(json.JSONEncoder): | ||
"""Encode python objects. | ||
Additonaly add encoding for datetime objects as isoformat. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
timvancann
force-pushed the
timvancann:google_pubsub
branch
from
cea6658
to
c08a13a
Feb 10, 2019
MartinHjelmare
approved these changes
Feb 10, 2019
amelchio
approved these changes
Feb 10, 2019
amelchio
merged commit d049b52
into
home-assistant:dev
Feb 10, 2019
wafflebot
bot
removed
the
in progress
label
Feb 10, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
timvancann commentedJan 13, 2019
•
edited
Description:
This adds the Google Pub/Sub component to directly post event changes from Home Assistant to Pub/Sub. This allows for many streaming applications, from cloud dashboarding to cloud data science.
Related issue (if applicable): fixes #
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8153
Example entry for
configuration.yaml
(if applicable):See new documentation
Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices: