Skip to content

Commit

Permalink
Remove deprecated Raspberry Pi Enable Camera option
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed May 5, 2023
1 parent 06c76b5 commit 914f837
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 31 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Bugfixes

- Fix setting Camera timelapse duration to 0
- Remove deprecated Raspberry Pi Enable Camera option

### Features

Expand Down
1 change: 1 addition & 0 deletions mycodo/inputs/k30.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def get_measurement(self):
low = resp[4]
co2 = (high * 256) + low
self.value_set(0, co2)
self.logger.debug(f"CO2: {co2}")
except:
self.logger.exception("UART")
elif self.interface == 'I2C':
Expand Down
2 changes: 0 additions & 2 deletions mycodo/mycodo_flask/forms/forms_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,6 @@ class SettingsPi(FlaskForm):
disable_spi = SubmitField(lazy_gettext('Disable SPI'))
enable_ssh = SubmitField(lazy_gettext('Enable SSH'))
disable_ssh = SubmitField(lazy_gettext('Disable SSH'))
enable_pi_camera = SubmitField(lazy_gettext('Enable Pi Camera'))
disable_pi_camera = SubmitField(lazy_gettext('Disable Pi Camera'))
hostname = StringField(lazy_gettext('Hostname'))
change_hostname = SubmitField(lazy_gettext('Change Hostname'))
pigpiod_sample_rate = StringField(lazy_gettext('Configure pigpiod'))
Expand Down
10 changes: 0 additions & 10 deletions mycodo/mycodo_flask/routes_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,6 @@ def page_camera():
opencv_devices = []
break

pi_camera_enabled = False
try:
if (not current_app.config['TESTING'] and
'start_x=1' in open('/boot/config.txt').read()):
pi_camera_enabled = True
except IOError as e:
logger.error("Camera IOError raised in '/camera' endpoint: "
"{err}".format(err=e))

if request.method == 'POST':
unmet_dependencies = None
if not utils_general.user_has_permission('edit_controllers'):
Expand Down Expand Up @@ -298,7 +289,6 @@ def page_camera():
misc=misc,
opencv_devices=opencv_devices,
output=output,
pi_camera_enabled=pi_camera_enabled,
time_lapse_imgs=time_lapse_imgs,
time_now=time_now)

Expand Down
12 changes: 0 additions & 12 deletions mycodo/mycodo_flask/templates/settings/pi.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,6 @@ <h3 style="text-align: right; padding-bottom: 1.3em;"><a href="https://kizniche.
{% endif %}
</div>
</div>
<div class="row small-gutters">
<div class="col">
Pi Camera is {% if pi_settings['pi_camera_enabled'] %}Enabled{% else %}Disabled{% endif %}
</div>
<div class="col">
{% if pi_settings['pi_camera_enabled'] %}
{{form_settings_pi.disable_pi_camera(class_='btn btn-primary')}}
{% else %}
{{form_settings_pi.enable_pi_camera(class_='btn btn-primary')}}
{% endif %}
</div>
</div>
<div class="row small-gutters">
<div class="col">
{{form_settings_pi.hostname(class_='form-control', value=pi_settings['hostname'])}}
Expand Down
6 changes: 0 additions & 6 deletions mycodo/mycodo_flask/utils/utils_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1595,12 +1595,6 @@ def settings_pi_mod(form):
elif form.disable_ssh.data:
_, _, status = cmd_output("raspi-config nonint do_ssh 1", user='root')
action_str = "Disable SSH"
elif form.enable_pi_camera.data:
_, _, status = cmd_output("raspi-config nonint do_camera 0", user='root')
action_str = "Enable Pi Camera"
elif form.disable_pi_camera.data:
_, _, status = cmd_output("raspi-config nonint do_camera 1", user='root')
action_str = "Disable Pi Camera"
elif form.change_hostname.data:
if is_valid_hostname(form.hostname.data):
_, _, status = cmd_output(
Expand Down
2 changes: 1 addition & 1 deletion mycodo/widgets/widget_graph_synchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def generate_page_variables(widget_unique_id, widget_options):
<div class="widget-graph-controls" id="widget-graph-controls-{{each_widget.unique_id}}">
<div class="widget-graph-responsive-controls" id="widget-graph-responsive-controls-{{each_widget.unique_id}}">
<a class="btn btn-sm btn-success" id="updateData{{each_widget.unique_id}}" title="{{_('Update')}}">
<i class="fa fa-sync-alt"></i>
<i class="fa fa-download"></i>
</a>
<a class="btn btn-sm btn-success" id="resetZoom{{each_widget.unique_id}}" title="{{_('Reset')}}">
<i class="fa fa-undo-alt"></i>
Expand Down

0 comments on commit 914f837

Please sign in to comment.