Skip to content

Upnp properties (fix)#8294

Closed
dgomes wants to merge 19 commits into
home-assistant:devfrom
dgomes:upnp_properties
Closed

Upnp properties (fix)#8294
dgomes wants to merge 19 commits into
home-assistant:devfrom
dgomes:upnp_properties

Conversation

@dgomes
Copy link
Copy Markdown
Contributor

@dgomes dgomes commented Jul 2, 2017

Description:

Fix to previous pull request #8067

If a user already has a port_mapping in its router (either through UPnP or other means (eg. Web Interface to router) the port_mapping code will fail.

This adds a persistent notification advising users to disable port_mapping (as already explained in the documentation)

Related issue (if applicable): fixes https://community.home-assistant.io/t/upnp-new-module/20839

@mention-bot
Copy link
Copy Markdown

@dgomes, thanks for your PR! By analyzing the history of the files in this pull request, we identified @robbiet480 and @fabaff to be potential reviewers.

Comment thread homeassistant/components/upnp.py Outdated
''.format(external_port),
title=NOTIFICATION_TITLE,
notification_id=NOTIFICATION_ID)
return False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

Comment thread homeassistant/components/upnp.py Outdated
except ConflictInMappingEntry as ex:
_LOGGER.error("UPnP failed to configure port mapping: %s", str(ex))
persistent_notification.create(
hass, 'Port {} is already mapped, please disable port_mapping<br />'
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 (80 > 79 characters)


except ConflictInMappingEntry as ex:
_LOGGER.error("UPnP failed to configure port mapping: %s", str(ex))
persistent_notification.create(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

undefined name 'persistent_notification'

Comment thread homeassistant/components/upnp.py Outdated

hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, deregister_port)

except ConflictInMappingEntry as ex:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

undefined name 'ConflictInMappingEntry'

Sorry…
upnp.deleteportmapping(hass.config.api.port, 'TCP')

hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, deregister_port)
persistent_notification = loader.get_component('persistent_notification')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

undefined name 'loader'

@dgomes dgomes changed the title Upnp properties Upnp properties (fix) Jul 2, 2017
@dgomes dgomes closed this Jul 2, 2017
@dgomes
Copy link
Copy Markdown
Contributor Author

dgomes commented Jul 2, 2017

I'm creating a new branch with this fix only.

@dgomes dgomes deleted the upnp_properties branch July 2, 2017 18:28
@dgomes dgomes restored the upnp_properties branch July 2, 2017 18:28
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 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.

5 participants