Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't error with "Unable to create WibeeeSensor" on unknown keys #7

Merged
merged 1 commit into from
Aug 25, 2021

Conversation

luuuis
Copy link
Owner

@luuuis luuuis commented Aug 25, 2021

Fixes an error where we try to add an unknown sensor without checking if it should be processed first.

2021-08-25 10:04:21 ERROR (MainThread) [custom_components.wibeee.sensor] Unable to create WibeeeSensor Entities for key fase1_angle and value 0.00
Traceback (most recent call last):
  File "/config/custom_components/wibeee/sensor.py", line 204, in set_sensors
    tmp_sensors.append(WibeeeSensor(self, self.sensor_name_suffix, sensor_id, sensor_phase, sensor_name,sensor_value))
  File "/config/custom_components/wibeee/sensor.py", line 126, in __init__
    friendly_name, unit, device_class = SENSOR_TYPES[sensor_name]
KeyError: 'angle'

@luuuis luuuis merged commit a8d75c3 into main Aug 25, 2021
@luuuis luuuis deleted the ignore-unknown-sensors branch August 25, 2021 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant