Julius2342 / pyvlx

PyVLX - controling VELUX windows with Python via KLF 200
GNU Lesser General Public License v3.0
77 stars 27 forks source link

Rain Sensor #67

Closed pergolafabio closed 3 years ago

pergolafabio commented 3 years ago

Hi, just a question

Is there a away to know if the rain sensor is detecting rain? regading the state of the windows? open/closed?

thnx in advance

pergolafabio commented 3 years ago

perfect, keep us posted :-) about PR, i can test it still using now my modified code, it works

pergolafabio commented 3 years ago

hmm, changed to master in manifest , but got some verry weird error now

2021-09-09 14:53:59 ERROR (MainThread) [homeassistant.bootstrap] Error setting up integration velux - received exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 98, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing.py", line 1654, in parseString
    raise exc
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing.py", line 1644, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing.py", line 3417, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing.py", line 1406, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing.py", line 3205, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pkg_resources._vendor.pyparsing.ParseException: Expected stringEnd (at char 3), (line:1, col:4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/package.py", line 38, in is_installed
    pkg_resources.get_distribution(package)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 464, in get_distribution
    dist = Requirement.parse(dist)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3139, in parse
    req, = parse_requirements(s)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3084, in parse_requirements
    yield Requirement(line)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3094, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 100, in __init__
    raise InvalidRequirement(
pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "'+https:/'": Expected stringEnd

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 105, in async_setup_component
    return await task  # type: ignore
  File "/usr/src/homeassistant/homeassistant/setup.py", line 199, in _async_setup_component
    await async_process_deps_reqs(hass, config, integration)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 381, in async_process_deps_reqs
    await requirements.async_get_integration_with_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 84, in async_get_integration_with_requirements
    await _async_process_integration(hass, integration, done)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 100, in _async_process_integration
    await async_process_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 154, in async_process_requirements
    if pkg_util.is_installed(req):
  File "/usr/src/homeassistant/homeassistant/util/package.py", line 45, in is_installed
    req = pkg_resources.Requirement.parse(urlparse(package).fragment)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3139, in parse
    req, = parse_requirements(s)
ValueError: not enough values to unpack (expected 1, got 0)
mago0211 commented 3 years ago

Are you sure everything is correct in Manifest file?

I have locally tested quick with an venv and everything works

$ python -m venv venv
$ source venv/bin/activate
(venv)$ pip install git+https://github.com/Julius2342/pyvlx.git@master
Collecting git+https://github.com/Julius2342/pyvlx.git@master
  Cloning https://github.com/Julius2342/pyvlx.git (to revision master) to ./pip-req-build-e1a7d0x0
Collecting PyYAML
  Using cached PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl (630 kB)
Using legacy 'setup.py install' for pyvlx, since package 'wheel' is not installed.
Installing collected packages: PyYAML, pyvlx
    Running setup.py install for pyvlx ... done
Successfully installed PyYAML-5.4.1 pyvlx-0.2.19
pergolafabio commented 3 years ago

yeah, this works , i forked yours :

{
  "domain": "velux",
  "name": "Velux",
  "documentation": "https://www.home-assistant.io/integrations/velux",
  "requirements": ["git+https://github.com/pergolafabio/pyvlx.git@add_limitations#pyvlx==0.2.20"],
  "codeowners": ["@Julius2342"],
  "version": "2021.1.1"  
}

this doesnt :

{
  "domain": "velux",
  "name": "Velux",
  "documentation": "https://www.home-assistant.io/integrations/velux",
  "requirements": ["git+https://github.com/Julius2342/pyvlx.git@master"],
  "codeowners": ["@Julius2342"],
  "version": "2021.1.1"  
}
pergolafabio commented 3 years ago

@Julius2342 do you have an idea? when i load your new master in HA, getting some strange errors, see a few posts above

"requirements": ["git+https://github.com/Julius2342/pyvlx.git@master"] https://github.com/Julius2342/pyvlx/issues/67#issuecomment-916065628