Skip to content

Issue #6893 in rfxtrx#9130

Merged
pvizeli merged 3 commits into
devfrom
rfxtrx_issue
Aug 29, 2017
Merged

Issue #6893 in rfxtrx#9130
pvizeli merged 3 commits into
devfrom
rfxtrx_issue

Conversation

@Danielhiversen
Copy link
Copy Markdown
Member

Description:

From #6893 (comment) :

This happens cause rfxtrx platforms depend on RFXtrx in the validation of the config. This won't work since the automatic install of requirements happen after the process of the config during setup, which includes config validation.

This might not be the best solution, so I am open for suggestions.
Merging this will make the make HA start for the first time without need of manually install PyRfxtrx, and still validate the config as good as possible with the available libraries.

Related issue (if applicable): fixes #6893

@mention-bot
Copy link
Copy Markdown

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

Comment thread homeassistant/components/rfxtrx.py Outdated
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 (84 > 79 characters)

Comment thread homeassistant/components/rfxtrx.py Outdated
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)

Comment thread homeassistant/components/rfxtrx.py Outdated
raise vol.Invalid('Rfxtrx device {} is invalid: Invalid'
' device id for {}'.format(key, value))
except ImportError:
_LOGGER.warning('Restart Home Assistant to'
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.

Shouldn't vol.Invalid be raised? Otherwise a possible invalid configuration could be passed as valid. What consequences would that have for downstream code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If we raise an error here, I think the rfxtrx lib never will be installed?
If the key is invalid the first time HA starts, the rfxtrx component should still load and install the rfxtrx lib, but the switch/sensor with an error will not be loaded.

Copy link
Copy Markdown
Member

@pvizeli pvizeli left a comment

Choose a reason for hiding this comment

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

I think we should validate the config without external library. We validate the config every time to look correct but if that will work can be we only look on setup like all other component/platforms

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Aug 29, 2017

Nice 👍

@pvizeli pvizeli deleted the rfxtrx_issue branch August 29, 2017 14:20
matemaciek added a commit to matemaciek/home-assistant that referenced this pull request Aug 30, 2017
* upstream/dev: (113 commits)
  Fix fitbit error when trying to access token after upgrade. (home-assistant#9183)
  Upgrade sendgrid to 5.0.1 (home-assistant#9215)
  Upgrade pyasn1 to 0.3.3 and pyasn1-modules to 0.1.1 (home-assistant#9216)
  directv: extended discovery via REST api, bug fix  (home-assistant#8800)
  Bayesian Binary Sensor (home-assistant#8810)
  Add cloud auth support (home-assistant#9208)
  Abode push events and lock, cover, and switch components (home-assistant#9095)
  Lint Sonarr tests
  Upgrade pymysensors to 0.11.1 (home-assistant#9212)
  Refactor rfxtrx (home-assistant#9117)
  Issue home-assistant#6893 in rfxtrx (home-assistant#9130)
  Support for season sensor (home-assistant#8958)
  Add counter component (home-assistant#9146)
  Fix and optimize digitalloggers platform (home-assistant#9203)
  Prevent error when no forecast data was available (home-assistant#9176)
  Add "status" to Sonarr sensor (home-assistant#9204)
  fix worldtidesinfo home-assistant#9184 (home-assistant#9201)
  Update pushbullet.py (home-assistant#9200)
  Fix dht22 when no data was read initially home-assistant#8976 (home-assistant#9198)
  Prevent iCloud exceptions in logfile (home-assistant#9179)
  ...
@balloob balloob mentioned this pull request Sep 7, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Dec 11, 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.

ImportError: No module named 'RFXtrx'

7 participants