* Fix#7758 subscription expiration/removal
Removes a subscription after receiving an HTTP 410 response when trying to send a new message.
* Fix tests failing due to additional call
* Fix code style
* Lint
* Start of migration framework, to allow moving of files in the config directory to be hidden, ios.conf used as the first one to undergo this change.
* Update const.py
* Update test_config.py
* improvement to syntax
* Remove setting up an hbmqtt broker
* Don't pass loop to web.Application in tests
* Use .query instead of deprecated .GET for aiohttp requests
* Fix closing file resource
* Do not use asyncio mark
* Notify.html5 - PyJWT: Use options to disable verify
* Yamaha: Test was still using deprecated ip
* Remove pytest-asyncio
* bugfix for Telegram chat_ids
- Negative `chat_id`s for groups.
- Include `chat_id` in event data.
- Handle KeyError when receiving other types of messages, as `new_chat_member` ones, and send them as text.
* unused import
* fix double quote style, fix boolean expr, change warning msg
* mistake
* some more fixes
- fix if condition for msg bad fields.
- return True for a correct but not allowed or not recognized message: if not, the message arrives continuously.
- Allow to receive messages from unauthorized users if they come from authorized groups.
* support for `edited_message`s
- They come as normal messages, except for the 'edited_message' field instead of 'message'.
* SMTP notify enhancements: HTML emails and customization options
- Send full HTML emails, with or without inline attached images.
- Custom `timeout`.
- Custom `product_name` identifier for the `FROM` and `X-MAILER` email headers.
- New HTML email test
* `sender_name` instead of product_name
- Change `sender_name` instead of `product_name`.
- No changes in `X-Mailer` header.
- `From` header as always unless you define the new `sender_name` parameter.
* telegram_bot and notify.telegram enhancements:
- Receive callback queries and produce `telegram_callback` events.
- Custom reply_markup (keyboard or inline_keyboard) for every type of message (message, photo, location & document).
- `disable_notification`, `disable_web_page_preview`, `reply_to_message_id` and `parse_mode` optional keyword args.
- Line break between title and message fields: `'{}\n{}'.format(title, message)`
- Move Telegram notification services to `telegram_bot` component and forward service calls from the telegram notify service to the telegram component, so now the `notify.telegram` platform depends of `telegram_bot`, and there is no need for `api_key` in the notifier configuration. The notifier calls the new notification services of the bot component:
- telegram_bot/send_message
- telegram_bot/send_photo
- telegram_bot/send_document
- telegram_bot/send_location
- telegram_bot/edit_message
- telegram_bot/edit_caption
- telegram_bot/edit_replymarkup
- telegram_bot/answer_callback_query
- Added descriptions of the new notification services with a services.yaml file.
- CONFIG_SCHEMA instead of PLATFORM_SCHEMA for the `telegram_bot` component, so only one platform is allowed.
- Async component setup.
* telegram_bot and notify.telegram enhancements: change in requirements_all.txt.
* Refactor matrix notify service.
This refactor aims to close#6118 by making the save / restore of the
authentication tokens much more resilient to failure.
It also refactors the module so that all the functionality is part of the class
and that a login failure causes the service to fail on setup rather than at
message send time.
* Make the linter overlords happy
* Improve logger levels and messages
* small style change
* Fix indentation issue
* updated pylgtv module to fix problems with timeouts
* - update pylgtv to 0.1.6
- handle new TimeoutError exception from pylgtv
* used full name for exception handling of concurrent.futures._base.TimeoutError
* the exception handling should now follow the rules
* float typecasting should not be necessary
* use asyncio for TimeoutError it’s an alias for concurrent.futures.TimeoutError
* Add link to docs and remove comments which are obvious
* Update docstrings
* Repleace conf details with link to docs
* Add link to docs
* Update docstrings
* Update import
* Update ordering
* Update ordering
* Update docstring
* Update ordering
* Update ordering
* Update to pylgtv 0.1.4
* Send icon with webostv notifications
Default to the homeassistant logo, but allow customizing it on the
component and for individual notifications
* new component telegram_webhooks
* keyboard support in telegram notify
* telegram_webhooks has no tests
* requirement like notify/telegram
* ops, requirements_all.txt needed for travis
* ops, requirements_all.txt is generated by script/gen_requirements_all.py
* check telegram trusted networks in web handler
* raise an event now
* use of hass.config.api.base_url
* more readable
* small cleanups
* Small style change for HA guideline
* fix lint
* revert return to origin
* Mailgun notify service
* Update dependency to version 1.3
- The provided credentials (including the domain) are now checked during
startup, as requested by @balloob
- The domain name is now optional
- There's a new config item "sandbox" which indicates whether to use the
sandboxed domain in case the domain is not set
* Fix a few lint issues
* Disable lint check no-value-for-parameter
* Added error checking to the MIMEImage encoding for smtp.py
Added fallback to file attachment rather than inline image for images
without a known MIME
* PEP8 reqs to fix previous commit
* Remove SPEED_MED from fan
* Add an Amazon Polly TTS platform
* Update boto library version for notify.aws_* platforms to match the tts.amazon_polly req
* Improve log line and add docstring to function
* Simplify config logic
* Remove duplicate logic
* Don't know how this got in here...
* initial options work
* Remove stale config option and only allow supported languages
* Make requested changes
* Polly is only supported in some regions
* Allow filename to contain underscores (for amazon_polly platform name), remove unnecessary default_lang, other small things
* Add options dict to service description
* Initial commit of discord notification component
* Fixed error where script added extra entries to .coveragerc
* Cleaned up code
* Compliance to PEP8
* removed dependencies
* readded dependencies
* changed name of client id to token for configuration
* Changes for Hound
* Incorporated Review Feedback
* Review feedback
* Updated requirements file
* Check compliance
* Add mysensors notify platform
* Make add_devices optional in platform callback function.
* Use new argument structure for all existing mysensors platforms.
* Add notify platform.
* Update mysensors gateway.
* Refactor notify setup
* Enable discovery of notify platforms.
* Update and add tests for notify component and some platforms.
* Continue setup of notify platforms if a platform fails setup.
* Remove notify tests that check platform config. These tests are not
needed when config validation is used.
* Add config validation to APNS notify platform.
* Use discovery to set up mysensors notify platform.
* Add discovery_info to get_service and update tests
* Add discovery_info as keyword argument to the get_service function
signature and update all notify platforms.
* Update existing notify tests to check config validation using test
helper.
* Add removed tests back in that checked config in apns, command_line
and file platforms, but use config validation test helper to verify
config.
* Add a test for notify file to increase coverage.
* Fix some PEP issues.
* Fix comments and use more constants
* Move apns notify service under notify domain
* Add Lannouncer notify component
* Send message by opening a raw TCP socket instead of using requests. Cleanup of method validation.
* Use 'return' instead of 'return None'
* Move HTTP to own folder
* Break HTTP into middlewares
* Lint
* Split tests per middleware
* Clean up HTTP tests
* Make HomeAssistantViews more stateless
* Lint
* Make HTTP setup async
Occassionally the values of `keys` and `p256h` are bytes objects instead of
strings. As JSON by default does not serialize bytes objects let's decode
bytes objects to unicode strings.
Resolves the registration issue mentioned in #4012.
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
Occassionally the values of `keys` and `p256h` are bytes objects instead of
strings. As JSON by default does not serialize bytes objects let's decode
bytes objects to unicode strings.
Resolves the registration issue mentioned in #4012.
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
* Added support for Notifications for Android TV / FireTV
* Silly me forgot to commit coverage
* Fixed pylint
* Fixed flake8
* Fixed another flake8 -.-
* Changed option 'ip' to 'host' like most other platforms do
* iOS component hot fixes around component/platform loading, logging, and more
* Load device_tracker and zeroconf in deps instead of bootstraping
* Change conditional check on status code
* Initial commit of the iOS component and platform
* Allow extra
* Add battery to identify, a new function to get devices, and load the upcoming sensor
* Add iOS sensor platform, currently for battery state & level
* Add discoverability for the iOS app
* Convert single quote to double quotes
* Load all required components and platforms when loading the iOS component for the best experience
* Unify quote style to double
* Change to hass_ios
* Update push URL, add support for logging based on status code, log rate limit updates
* Block iOS from coverage checks for now...
* Telstra API component
* import PLATFORM_SCHEMA
* Exclude Telstra notify component in coveragerc
* fix authentication issues
* Include title in SMS if it's provided
* pass lint
* Fix many code styling issues
* Confirm credentials are correct on component setup
* added push notification implementation
* some lint changes
* added docs
* added push notification implementation
* some lint changes
* added docs
* Fixed comment formatting issues
* Added requirments
* Update requirements_all.txt
* Update apns.py
* re-generated requirments_all.txt
* Added link to online docs
* added push notification implementation
* some lint changes
* added docs
* added push notification implementation
* some lint changes
* added docs
* Fixed comment formatting issues
* Added requirments
* Update requirements_all.txt
* Update apns.py
* re-generated requirments_all.txt
* Added link to online docs
* changed to use http/2 library for push notifications
* fixed lint issue
* fixed test that fails on CI
* another go at fixing test that fails on CI
* another go at fixing test that fails on CI
* another go at fixing test that fails on CI
* added missing docstring
* moved service description to main services.yaml file
* renamed apns service
* Update notify to expect a list of string targets instead of a single string
* Actually do the thing I set out to do
* Fix notify.group test to expect an array of targets
* REST platform will only use the first target in the list
* Update notify platforms to expect a list of targets
* Update notify services.yaml
* Add support for notifying with Slack messages.
When creating notifications, this allows you to pass in `attachments`
with the `data`. It's an array of attachments as defined in
https://api.slack.com/docs/message-attachments
When passing in attachments, message is still required, but it's okay to
be a blank string.
* Split over multiple lines
* Make sure attachments gets assigned, even if there isn't attachment data
Current documentation suggests to use personal API tokens. This isn't
ideal because for a few reasons:
* messages will come as your own user, so it's hard to tell it's coming
from hass
* it's harder to manage if multiple people are using Slack and home
* assistant, since you'd have to coordinate rolling of it
It is possible to use Slack bot users already. Just make a new one from https://your-team.slack.com/apps/build/custom-integration, and use the token for that. You can even add an icon from the web frontend for home assistant.
However, the message will appear as a bot without a name or icon. This pull requests fixes this by passing the as_user parameter, which uses the bot user's name and icon.
One caveat is you need to invite the bot user into the room you want to
post to. This probably was an issue before though.
🎩 to @jnewland who pointed me to this in his branch
* Add action and callback support to html5 (#2855).
Remove registrations from the callback view since we always get the latest anyway.
We dont put an audience in the claims so we will never hit this error.
Bring tests back up to where they were before callbacks.
Only import jwt where necessary
Fix bracket spacing errors
Fix JWT decode check for loop
Remove stale comment.
Add tests for the callback system.
Shorten line
Disable pylint broad-except and change e to jwt_decode_error.
Verify expiration
Remove duplicate jwt.exceptions.DecodeError
Catch no keys matched and return False
* Switch to using registrations for callbackview instead of json_path
* Only check for URL and such if the data object actually exists
* raise instead of return
* cleanup decode_jwt
* Clean up JWT errors
* Correctly set status_code to 401
* Improve JWT by adding target to claims and attempting to check the given target for a decode match first, as well as pass the target through in the event payload.
* Add tag support and fix formatting issues
* Pass through any keys that dont apply to the payload into the notification.data dictionary
* Remove stale print
* Pass back the data dictionary if it exists
* Actually put the default url even if a notify payload dictionary doesnt exist
* pylint, flake8
* Add subscription validation
* Add validation for the callback event payload and use constants where possible
* Use HTTP_UNAUTHORIZED instead of 401
* Change callback dictionary to dict instead of cv.match_all
* Fix up tests and make subscription required
* Whoops, that test was supposed to fail
* Use the result of CALLBACK_EVENT_PAYLOAD_SCHEMA as event_payload
* Add a test for html5 callback decode_jwt where the device has been renamed since notification has been sent.
* Remove the loop through logic, assume that target is always in JWT
* Always return something instead of possibly None.
* Update frontend
* Add a group notify platform which allows sending a single notification to multiple platforms.
* Correctly sort group.py
* Clean up the payload logic
* Make name and entity id required in the schema
* Deep update the dictionary to fix a bug where data wasnt merging.
* Add notify.group tests.
* Improve docstrings.
* Change entities to services and entity_id to service
* Make service a slug without a default value
* Update tests for entities->services, entity_id->service
* vol.Any(cv.slug) -> cv.slug
* First pass on providing individual services for all possible targets that a notification platform supports.
* Add a quite hacky first version of notification groups
* Add a docstring for get_targets
* Register group service under notifygroup/ and safely check for notifygroups in config
* Remove notifygroups, because it belongs in its own PR
* Make @balloob requested changes
* get_targets()->targets
* Add tests for notify targets exposed as individual services
* If we dont have a platform name set in configuration, lets use the name of the platform instead of notify
* Fix test docstring.
* Dont use a dictionary for just one value
* No need to double slugify
* targets is now just a list of strings instead of a dict
* Retry sending the push for 1 day instead of failing instantly if the target is unavailable
* Add timestamp to push payload
* Correctly use the title and body fields for their intended purposes
* Add callback support
* Revert changes to frontend files.
* Add default URL which will open Home Assistant. Also put all the data into the data object of the payload so it is accessible in the browser. Without doing this, things like URL wouldnt be accessible.
* Flake8 and pylint fixes
* event->type
* Dont send the default url if actions exist
* flake8/pylint fixes again
* Update html5 tests
* Remove callbacks from this branch, will re-stage on a different branch
* Remove remnant of callbacks
* Add url to data dictionary if it exists instead of copying the entire data dictionary in
* flake8 fix
* Initial work to add Chrome Push Notification support
* Remove push.js from home-assistant since it is now in Polymer
* Chrome->HTML5, general cleanup/fixes
* Make html5 generic, move manifest.json into frontend so that we can dynamically add the gcm_sender_id
* Pylint, flake8, pydocstyle frontend init
* HTML5 push fixes
* Update polymer
* Remove crypto req
* Add notify default platform.
* Fix HTML5 push
* Registration fixes
* Linting fix
* pep257 fix
* Add tests
* pep257 fix
* Update frontend
* Added optional embedded image attachments to notify.smtp.
Also restructured a bit to minimize code duplication and add some tests.
* Fixed formatting errors.
* SMTP cleanups thanks to code review.
* initial support for Join notifier
add more functions for Join
* rename to joaoapps_join
add message default in schema
move api_key check
* move special join services to their own component
update coveragerc and requirements_all
add icon and smallicon
* AWS SNS notify platform
* Attach kwargs as MessageAttributes
* Initial pass of AWS SQS platform
* Add Lambda notify platform
* Remove unused import
* Change single quotes to double quotes because I am crazy
* Forgot to run pydocstyle
* Improve context support for Lambda
* compress the message_attributes logic
* Log error for services called without required attributes, in
media_player, notify and thermostat platforms.
* Add fan property and methods in thermostat demo component.
* Add tests for notify file and thermostat demo component.
* Increase coverage of tests for media_player, notify and thermostat
platforms.
* Fix some PEP issues, but not all. Tests still have old linting
errors.