Skip to content

Commit

Permalink
Small metadata and camera improvements (#1253)
Browse files Browse the repository at this point in the history
* Clean up metadata saving.

Updating current metadata record should clobber, not merge.

* * Changing gphoto2 log entry to a warning.
* Try to get camera model.

* * Fix variable name.

* * Fix incorrect log entry.
  • Loading branch information
wtgee authored May 2, 2024
1 parent e0bb372 commit 6bdacc8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/panoptes/pocs/camera/gphoto/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def get_command_result(self, timeout: float = 10) -> Union[List[str], None]:

self.logger.trace(f'gphoto2 output: {outs=!r}')
if errs != '':
self.logger.error(f'gphoto2 error: {errs!r}')
self.logger.warning(f'gphoto2 error: {errs!r}')

if isinstance(outs, str):
outs = outs.split('\n')
Expand Down
3 changes: 1 addition & 2 deletions src/panoptes/pocs/camera/gphoto/canon.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ def connect(self):

self.set_properties(prop2value=prop2value)

# TODO check this works on all Canon models.
self.model = self.get_property('d402')
self.model = self.get_property('model')

self._connected = True

Expand Down
2 changes: 1 addition & 1 deletion src/panoptes/pocs/state/states/default/parked.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def on_enter(event_data):
pocs.next_state = 'housekeeping'
break
else:
pocs.say("Seems to be bad weather. I'll wait another 30 minutes.")
pocs.say("Seems to be bad weather. I'll wait another 5 minutes.")
2 changes: 1 addition & 1 deletion src/panoptes/pocs/utils/cli/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def handleEvent(event):
print(f'Adding {data=}')

# Update the "current" record.
metadata_record.set(data, merge=True)
metadata_record.set(data)
# Add a new record.
doc_ts, doc_id = records_ref.add(data)
if verbose:
Expand Down
4 changes: 2 additions & 2 deletions src/panoptes/pocs/utils/cli/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def get_page(page, base_url):


@app.command(help='Restart the weather station service via supervisorctl')
def restart(serivce: str = 'pocs-weather-reader'):
def restart(service: str = 'pocs-weather-reader'):
"""Restart the weather station service via supervisorctl"""
cmd = f'supervisorctl restart {serivce}'
cmd = f'supervisorctl restart {service}'
print(f'Running: {cmd}')
subprocess.run(cmd, shell=True)

Expand Down

0 comments on commit 6bdacc8

Please sign in to comment.