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

Error on configure after camera deleted in bi #191

23 changes: 23 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
42 changes: 34 additions & 8 deletions custom_components/blueiris/managers/config_flow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,49 +146,75 @@ def get_default_options(self) -> vol.Schema:

drop_down_fields = [
{
"checked": config_data.allowed_camera,
"checked": [
i for i in config_data.allowed_camera if i in supported_camera
],
"items": supported_camera,
"name": CONF_ALLOWED_CAMERA,
"enabled": True,
},
{
"checked": config_data.allowed_connectivity_sensor,
"checked": [
i
for i in config_data.allowed_connectivity_sensor
if i in supported_camera_sensor
],
"items": supported_camera_sensor,
"name": CONF_ALLOWED_CONNECTIVITY_SENSOR,
"enabled": DATA_MQTT in self._hass.data,
},
{
"checked": config_data.allowed_audio_sensor,
"checked": [
i
for i in config_data.allowed_audio_sensor
if i in supported_audio_sensor
],
"items": supported_audio_sensor,
"name": CONF_ALLOWED_AUDIO_SENSOR,
"enabled": DATA_MQTT in self._hass.data,
},
{
"checked": config_data.allowed_motion_sensor,
"checked": [
i
for i in config_data.allowed_motion_sensor
if i in supported_camera_sensor
],
"items": supported_camera_sensor,
"name": CONF_ALLOWED_MOTION_SENSOR,
"enabled": DATA_MQTT in self._hass.data,
},
{
"checked": config_data.allowed_dio_sensor,
"checked": [
i
for i in config_data.allowed_dio_sensor
if i in supported_camera_sensor
],
"items": supported_camera_sensor,
"name": CONF_ALLOWED_DIO_SENSOR,
"enabled": DATA_MQTT in self._hass.data,
},
{
"checked": config_data.allowed_external_sensor,
"checked": [
i
for i in config_data.allowed_external_sensor
if i in supported_camera_sensor
],
"items": supported_camera_sensor,
"name": CONF_ALLOWED_EXTERNAL_SENSOR,
"enabled": DATA_MQTT in self._hass.data,
},
{
"checked": config_data.allowed_profile,
"checked": [
i for i in config_data.allowed_profile if i in supported_profile
],
"items": supported_profile,
"name": CONF_ALLOWED_PROFILE,
"enabled": is_admin,
},
{
"checked": config_data.allowed_schedule,
"checked": [
i for i in config_data.allowed_schedule if i in supported_schedule
],
"items": supported_schedule,
"name": CONF_ALLOWED_SCHEDULE,
"enabled": is_admin,
Expand Down