Skip to content

Commit

Permalink
Merge branch 'release/v1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Apr 28, 2020
2 parents 9eee59f + 568b80a commit 652a7ae
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 11 deletions.
76 changes: 74 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/.idea/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -107,3 +105,77 @@ venv.bak/

/test*.py
/dev-config



# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
11 changes: 11 additions & 0 deletions .idea/ha-iaquk.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
language: system
types: [python]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v2.5.0
hooks:
- id: check-json
- id: check-yaml
Expand Down
7 changes: 4 additions & 3 deletions custom_components/iaquk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def iaq_index(self) -> Optional[int]:
"""Get IAQ index."""
return self._iaq_index

# pylint: disable=r1705
# pylint: disable=R1705
@property
def iaq_level(self) -> Optional[str]:
"""Get IAQ level."""
Expand Down Expand Up @@ -244,6 +244,7 @@ def _get_number_state(self, entity_id, entity_unit=None, source_type='',
if entity_unit is not None:
target_unit = next(iter(entity_unit))
if unit not in entity_unit:
# pylint: disable=R1705
if mweight is None:
_LOGGER.error('Entity %s has inappropriate "%s" units '
'for %s source. Ignored.', entity_id, unit,
Expand All @@ -254,13 +255,13 @@ def _get_number_state(self, entity_id, entity_unit=None, source_type='',
if 'ppb' in (unit, target_unit):
mweight /= 1000
if unit in {'ppm', 'ppb'}:
entity_unit[unit] = 0.0409 * mweight
entity_unit[unit] = mweight / 24.45
else:
entity_unit[unit] = 24.45 / mweight

try:
value = float(value)
except: # pylint: disable=w0702
except: # pylint: disable=W0702
return None

if entity_unit is not None and unit != target_unit:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/iaquk/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Base component constants
DOMAIN = "iaquk"
VERSION = "1.3.0"
VERSION = "1.3.1"
ISSUE_URL = "https://github.com/Limych/ha-iaquk/issues"
ATTRIBUTION = None
DATA_IAQUK = 'iaquk'
Expand Down Expand Up @@ -54,7 +54,7 @@
'µg/m^3': 1000,
}

MWEIGTH_TVOC = 78.9516 # g/mol
MWEIGTH_TVOC = 56.1060 # g/mol
MWEIGTH_HCHO = 30.0260 # g/mol
MWEIGTH_CO = 28.0100 # g/mol
MWEIGTH_NO2 = 46.0100 # g/mol
Expand Down
6 changes: 4 additions & 2 deletions dev-setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh

pip3 install pre-commit
pip3 install -r requirements.txt -r requirements-dev.txt --user
pre-commit install
pre-commit autoupdate
chmod a+x update_tracker.py

if [ -d /run/user/1001/gvfs/smb-share:server=hassio,share=config/ ]; then
ln -s /run/user/1001/gvfs/smb-share:server=hassio,share=config/ dev-config
CONFIG=/run/user/$(id -u)/gvfs/smb-share:server=hassio,share=config/
if [ -d "$CONFIG" ] && [ ! -e dev-config ]; then
ln -s "$CONFIG" dev-config
fi
2 changes: 1 addition & 1 deletion tracker.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"iaquk": {
"version": "1.3.0",
"version": "1.3.1",
"local_location": "/custom_components/iaquk/__init__.py",
"remote_location": "https://raw.githubusercontent.com/Limych/ha-iaquk/master/custom_components/iaquk/__init__.py",
"visit_repo": "https://github.com/Limych/ha-iaquk",
Expand Down

0 comments on commit 652a7ae

Please sign in to comment.