Skip to content

Allow multiple Transmission clients and add unique_id to entities#28136

Merged
balloob merged 3 commits into
home-assistant:devfrom
engrbm87:transmission_uniqie_id
Oct 23, 2019
Merged

Allow multiple Transmission clients and add unique_id to entities#28136
balloob merged 3 commits into
home-assistant:devfrom
engrbm87:transmission_uniqie_id

Conversation

@engrbm87
Copy link
Copy Markdown
Contributor

Description:

Allow multiple Transmission Clients to be configured. Disable integration entities using the Entity Registry.

Example entry for configuration.yaml (if applicable):

transmission:
  - host: 127.0.0.1

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

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

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@MartinHjelmare MartinHjelmare changed the title Allow multiple Transmission clients and add unquie_id to entities Allow multiple Transmission clients and add unique_id to entities Oct 23, 2019
Comment thread homeassistant/components/transmission/__init__.py
Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

ok to merge when scan interval removed from the config flow.

@balloob balloob merged commit 7cb6607 into home-assistant:dev Oct 23, 2019
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Some adjustments needed in a follow up PR. Looks good otherwise.

hass.services.async_remove(DOMAIN, SERVICE_ADD_TORRENT)
if hass.data[DOMAIN][entry.entry_id].unsub_timer:
hass.data[DOMAIN][entry.entry_id].unsub_timer()
client = hass.data[DOMAIN][config_entry.entry_id]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could pop the client here already.

"""Update scan interval."""

def refresh(event_time):
async def refresh(event_time):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be reverted. The TransmissionData instance methods are not async safe.

assert result["data"][CONF_PASSWORD] == PASSWORD
assert result["data"][CONF_PORT] == PORT
assert result["data"]["options"][CONF_SCAN_INTERVAL] == DEFAULT_SCAN_INTERVAL
# assert result["data"]["options"][CONF_SCAN_INTERVAL] == DEFAULT_SCAN_INTERVAL
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stale code.

assert result["data"][CONF_HOST] == HOST
assert result["data"][CONF_PORT] == PORT
assert result["data"]["options"][CONF_SCAN_INTERVAL] == DEFAULT_SCAN_INTERVAL
# assert result["data"]["options"][CONF_SCAN_INTERVAL] == DEFAULT_SCAN_INTERVAL
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stale code.

@lock lock Bot locked and limited conversation to collaborators Oct 24, 2019
@engrbm87 engrbm87 deleted the transmission_uniqie_id branch September 16, 2022 09:07
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.

4 participants