Skip to content

Fix Push notifications subscription expiration/removal#7761

Closed
hoh wants to merge 10 commits into
home-assistant:devfrom
hoh:fix-html5-410
Closed

Fix Push notifications subscription expiration/removal#7761
hoh wants to merge 10 commits into
home-assistant:devfrom
hoh:fix-html5-410

Conversation

@hoh
Copy link
Copy Markdown
Contributor

@hoh hoh commented May 25, 2017

Description:

Related issue: fixes #7758

Example entry for configuration.yaml (if applicable):

notify:
  - name: HTML5PUSH
    platform: html5

Checklist:

If the code communicates with devices, web services, or third-party tools:

  • Local tests with py.test run successfully.
  • Tests handle HTTP response code from the push service (TODO)

balloob and others added 9 commits May 20, 2017 22:34
* 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'.
Web streams can't be paused and resumed later. That's why volumio stops them instead of pausing them.
If OpenWRT isn't running the DHCP server then some OpenWRT hardware,
such as TP-Link TL-WDR3600 v1, can't determine the host
corresponding to an associated wifi client. This change handles that
by returning None when the request has no data in the result.
Removes a subscription after receiving an HTTP 410 response when trying to send a new message.
self.registrations[target] = reg
_LOGGER.error("Error saving registration.")
else:
_LOGGER.info("Configuration saved") No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

no newline at end of file

if (response.status_code == 410):
_LOGGER.info("Notification channel has expired")
reg = self.registrations.pop(target)
if not _save_config(self.registrations_json_path, self.registrations):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (86 > 79 characters)

@balloob
Copy link
Copy Markdown
Member

balloob commented May 25, 2017

It looks like you branched off master. Could you rebase off dev?

@balloob balloob mentioned this pull request Jun 3, 2017
2 tasks
@balloob
Copy link
Copy Markdown
Member

balloob commented Jun 3, 2017

I have cherry-picked your commits into a new PR: #7874

Thanks for your contribution 👍

@balloob balloob closed this Jun 3, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Sep 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML5 Push notifications do not handle subscription expiration/removal

8 participants